Hello sir I have lot of tasks and I'm trying to automate them but the problem is when I disconnect from RDP the Selenium IDE is not working I have tested everything on the whole internet like gpedit regedit everything and also just dont tell to put bat file or command to keep it connected to local user like chromedriver(selenium).
Related
I am using vscode remote ssh and connect to my server (a node in a cluster) via ssh.
My local machine is Windows and my Host is ubuntu.
My vscode is being used to code in python.
I am trying for weeks to be able to run a python code and display images in the debug console like what we do in the normal terminal or in jupyter notebook, but I notice that I cannot display the image in the debug console at all.
here is a toy example
import numpy as np
import matplotlib.pyplot as plt
img = np.random.rand(300,200)
plt.imshow(img);plt.show()
basically when I try to do plt.imshow(img);plt.show() in the debug console I either get nothing or I get qt.qpa.screen: QXcbConnection: Could not connect to display localhost:0.0 Could not connect to any X display. .
I tried several methods such as using x11 extenson or adding x11 forwarding in the putty or add Display in the launch.json. However, none of them works.
I am coming to the conclusion that vscode remote ssh and debug console in python dont have that feature yet. But if you know a way to do it PLEASE let me know.
I hope that I am clear that displaying image in the normal situation is working and it is not working in the debug situation.
Please note that when I am doing the debug I dont want to display the image out side of the debug console.
Thanks
it seems you have done the first steps of my proposed solution.
open your settings in vscode with ctrl+, and search for terminal.integrated.env.linux. Click Edid settings.json
Update terminal.integrated.env.linux to this
"terminal.integrated.env.linux": {
"DISPLAY": "localhost:10.0",
}
Shut down vscode
Open ssh conncetion to server with ssh -X user#host
Open vscode and use remote development add-on as usually.
Now, this will work indefinitely, just open the x11-forwarding on the side every time. The downside, for which I am currently searching for solution is that you need to remove the "DISPLAY": "localhost:10.0" every time you wish to develop locally, which is not optimal.
Edit: Since you are apparently using windows, you need to configure putty with X11 forwarding and use xming or other x11-forwarding software in place of my step 4.
I am trying to connect my windows 10 computer with a ubuntu16.04 by a vnc by following this introduction.
I'm able to conect but what I see there is not very usefull, since I only see one folder opend where I can navigate and open files. But I'm not able to open a terminal nor anything else. Like you can see in the screenshot.
Does somebody knows how to realy get use of the vnc, like I'm really using it?
I am using pyautogui in Windows 10 with Python 3, in a virtual machine accessed by remote desktop.
Unfortunately, the program stops execution when I close remote connection, giving "OSError: screen grab failed".
I've searched for a solution online, but the only workaround that I've found is from this link
Use a remote desktop client that allows you to keep outputting the display, even if you minimise the window/close your PC. I used terminals (https://terminals.codeplex.com/ - not affiliated with them at all just recommending as it solved this issue for me).You can set this up to persist the display, and your code should then run fine.
The problem is that I can't find a setting for persisting display. I've also found this:
pyautogui._pyautogui_x11._display = Xlib.display.Display(
os.environ['DISPLAY']
)
... but it doesn't seems to work either (gives me errors...).
Do you have some workaround to do the trick?
Based on an answer from here:
when you disconnect from RDP, Windows lock the computer and does not render the screen any more so any automation apps which needs GUI fails to work.
To disconnect from RDP without losing the screen you can disconnect using following commands as administrator (its better to make a bat file and run that file as administrator when you need to disconnect from RDP):
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console )
I have resolved using TightVNC instead of remote desktop and detaching mouse cursor.
I am running tests from phpunit using selenium. Since the tests take a couple of minutes proceed, I would like to switch to another desktop and do some tasks while the tests are running in the background.
However, since every test calls a new browser via selenium remote server, and a new test management window and a application window are started, these new windows do not appear in the desktop which I started the php tests from, but in my current desktop taking the focus away from the window I am working in.
How can I control that the browsers are always opens in the desktop that is in the background (where I start phpunit)? I am using Kubuntu i.e. the KDE Desktop.
Thanks for any suggestions!
This is probably a bit late, but for anyone reading this: When you launch your selenium RC server, you could try exporting to a specific display using the command:
export DISPLAY="somedisplay" && java -jar /path/to/selenium-server.jar
Using this, you could also export it to for instance an X virtual frame buffer (Xvfb), effectively running it in the background.
I am using Selenium to conduct user interface tests with JUnit, in a Maven project. The project is located on a Linux box running IEs4Linux and Wine to allow us to run the tests in IE.
Right now I'm using Xming along with Putty to view the virtual browser windows, and I am able to open an IE window with the command "ie6", and I can see it functioning correctly in Xming.
When setting up the Selenium RC using the *iexplore browser mode, I get the following in the RC server window:
INFO - Command request: getNewBrowserSession[*iexplore, http://asdfasdfasdf.com:7011/, ] on session null
INFO - creating new remote session
INFO - Allocated session asdfasdfasdfasdfasdfasdfadsf for http://asdfasdfasdf.com:7011/, launching...
INFO - Launching Embedded Internet Explorer...
INFO - Launching Internet Explorer HTA...
Which is normal, except the browser never opens and the tests never run. Using *iexploreproxy or *piiexplore, I get the following error from the RC:
13:46:06.957 INFO - Got result: Failed to start new browser session: org.openqa.selenium.server.browserlaunchers.WindowsUtils$WindowsRegistryException: Problem while managing the registry, OS Version '2.6.18-164.11.1.el5', regVersion1 = null on session null
Is there any reason Selenium would fail to launch the IE window using *iexplore? I would use *firefox or *chrome but the application I am testing is only compatible with IE. Also note that these test cases run perfectly fine on my local Windows machine.
Please let me know if you need more details.
Got it working...in case anybody else attempts to use a similar configuration to mine...for whatever reason it seems you cannot start up the server with the Http.proxyName and Http.proxyPort settings when using IEs4Linux to open IE6...it will just ignore them. You have to manually open the IE6 browser and enter the proxy settings yourself (most likely localhost and 4444).
I think I'll start looking into IE7 for Linux...apparently IE6 doesn't like Selenium's use of XPaths.