I have a sikuli script which does the Siebel Tools incremental Compilation Task on a Windows Box from Jenkins.
The problem is: When i run the task i always have to open the RDC window open for the task to be executed.As soon i minimize the window the script fails.
Hence if the Sikuli script is running i will not able to use my local system for any other task.
I found some posts on launchpad.net.
this is one reference: https://answers.launchpad.net/sikuli/+question/213636
But it did not work.
Can anyone help on this.
This solution has helped me out:
Close all open Remote Desktop sessions.
Launch the Registry editor (regedit.exe).
Navigate to one of the following Registry keys, depending on whether you wish to modify the Remote Desktop settings only for the current user or for all users on the computer:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
Create a DWORD value named RemoteDesktop_SuppressWhenMinimized and set it to 2.
Close the Registry Editor.
After these steps are done RDC when minimized will not be suppressed and sikuli will work.
Answer taken from:
https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/in-minimized-window.html
Other solution is to use VNC connection instead of RDC. RealVNC for example.
You setup VNC server on machine that sikuli scripts are running on and connect from your other machine. You should even be able to close the connection window and scripts should still be able to run.
You could just keep the RDC session running in the background. Just don't minimize it. I am doing the same with my tests.
Related
I want to automate a very old software (drafix) that can only be run in Windows XP, on a remote desktop.
Would it be possible to write a pywinauto script that would directly interact with the software controls, without the need to send mouse/keyboard clicks on the GUI, and then minimize the Remote Desktop screen or even lock the PC?
I need to open the program, loop through a list of file names, open each one of them and save as a different format.
I did it with some basic GUI automation - clicking on buttons if necessary, sending keyboard shortcuts and entering the file names form a list. But it isn't very reliable, and I would like to minimize the Remote Desktop window and use my PC instead of having it in the foreground.
From what I have read here, it should be possible with some workarounds, and I would need to install an older version of Python (any idea which one?) on the remote desktop to write and run the script there.
What you can do is just copying your script to remote machine and run it there. Regarding minimized or closed RDP there are few workarounds and tricks described in the Remote Execution Guide which summarizes few StackOverflow answers.
There is other way that you can control gui application on remote Desktop with pywinauto. You can use rpyc or Remote Python Call. that is a python library for rpc(remote procedure call)
https://rpyc.readthedocs.io/en/latest/
your remote computer is as server and your host is as client in rpyc.
first you you need to run rpyc_classic.py in remote computer after connect to it and use pywinauto library. for example i use rpyc for start microsip on remote computer with pywinauto.
ip of remote computer is 192.168.222.222.
import rpyc
ip = "192.168.222.222"
conn = rpyc.classic.connect(ip)
conn.execute("from pywinauto import Application")
conn.execute(r"Application().start(r'C:\Program Files (x86)\MicroSIP\microsip.exe')")
I tried to do this with WMI, but interactive processes cannot be started with it (as stated in Microsoft documentation). I see processes in task manager, but windows do not show.
I tried with Paramiko, same thing. Process visible in task manager, but no window appears (notepad for example).
I tried with PsExec, but the only case a window appears on the remote machine, is when you specify -i and it does not show normally, only through a message box saying something like "a message arrived do you want to see it".
Do you know a way to start a program remotely, and have its interface behave like it would if you manually started it?
Thanks.
Normally the (SSH) servers run as a Windows service.
Window services run in a separate Windows session (google for "Session 0 isolation"). They cannot access interactive (user) Windows sessions.
Also note that there can be multiple user sessions (multiple logged in users) in Windows. How would the SSH server know, what user session to display the GUI on (even if it could)?
The message you are getting is thanks to the "Interactive Services Detection" service that detects that a service is trying to show a GUI on an invisible Session 0 and allows you to replicate the GUI on the user session.
You can run the SSH server in an interactive Windows session, instead as a service. It has its limitations though.
In general, all this (running GUI application on Windows remotely through SSH) does not look like a good idea to me.
Also this question is more about a specific SSH server, rather that about an SSH client you are using. So you you include details about your SSH server, you can get better answers.
ok i found a way. With subprocess schtasks( the windows task scheduler). For whatever reason, when i launch a remote process with it , it starts as if i had clicked myself on the exe. For it to start with no delay, creating the task to an old date like 2012 with schtasks /Create /F and running the then named task with schtasks /Run will do the trick
So I am trying to set up a Continuous integration environment using Jenkins.
One of the build step requires a series of mouse actions/movements to accomplish a task in Excel. I have already written a python script using the ctypes library to do this.
The script works perfectly fine if I run it either through Jenkins or on the server itself when I am actively logged in to the server using remote desktop connection, but as soon as I minimize/close the connection and then run the script from Jenkins, it seems the mouse events never get executed. Is there something I can add to the script to make this work? Thanks for any help you can provide.
I have a simple python script to send data from a Windows 7 box to a remote computer via SFTP. The script is set to continuously send a single file every 5 minutes. This all works fine but I'm worried about the off chance that the process stops or fails and the customer doesn't notice the data files have stopped coming in. I've found several ways to monitor python processes in a ubuntu/unix environment but nothing for Windows.
If there are no other mitigating factors in your design or requirements, my suggestion would be to simplify the script so that it doesn't do the polling; it simply sends the file when invoked, and use Windows Scheduler to invoke the script on whatever schedule you need. By relying on a core Windows service, you can factor that complexity out of your script.
You can check out restartme the following link shows how you can use it
http://www.howtogeek.com/130665/quickly-and-automatically-restart-a-windows-program-when-it-crashes/
I set up a job that want to execute an action that open the local browser. I write it use the python script:
import webbrowser
if __name__=="__main__":
webbrowser.open("http://www.example.com")
Then,i click Build now button on jenkins dashboard, it can execute successful and show successful as a result at last. But nothing happen for browser.It's very wierd that other python script could execute correctly, I have no idea why?
Addition:This jenkins(Jenkins ver. 1.524) is installed on my laptop and my laptop's OS is Win7, i start jenkins as a Windows Service. Do u have any idea?
If you are running Jenkins as a Windows service, by default it runs as user Local System. Did you check the box titled "Allow service to interact with desktop"?. If that does not help you may have to set the service to log on as an actual user, instead of Local System. This is a common problem with running any process with a GUI from Jenkins.