Running UI tests on Windows SSH slave

446 views
Skip to first unread message

Mani Azizzadeh

unread,
May 20, 2014, 1:37:27 AM5/20/14
to jenkins...@googlegroups.com
Hi, I have a windows slave where I want to run automated UI tests. Because of organizational requirements I need to run it as an SSH slave (cannot use jnlp). The problem is that cygwin ssh server runs as a service and therefore runs the UI tests in another session/desktop. This causes problems for me and the automation is not working as expected and is not visible either.

I was thinking if there is an easy way to run cygwin sshd as a regular process in the user session of a logged in user, could that be an alternative?

The other alternative I could think of is to use a tool like psexec to force the automation process to run in the interactive desktop of the logged in user.

What do you think, any experiences of this scenario? All suggestions are very appreciated.

Stephen Connolly

unread,
May 20, 2014, 4:13:15 AM5/20/14
to jenkins...@googlegroups.com
you might get somewhere following the answer to this question: http://serverfault.com/questions/344295/is-it-possible-to-run-sshd-as-a-normal-user

given tha cygwin's sshd should be somewhat close to a normal sshd, you might get lucky and find that UsePrivilegeSeparation no does what you want. You also will need to launch sshd not as a service but from the desktop so that you get access to *both* the network *and* the desktop. Running as a service you need to pick which one of those your service gets access to IIRC

DISCLAIMER: it is *years* since I have used Windows... lucky me!


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mani Azizzadeh

unread,
May 26, 2014, 9:42:56 AM5/26/14
to jenkins...@googlegroups.com
 
 

 
Stephen: thanks for your anwser, windows can sometimes be a pain. :)
I am posting this here if anyone else would be in the same situation and is in need to run ui tests via ssh slave.

I went and checked the archives for cygwin and basically what I found there was that you can run its' sshd as a regular user in the logged in users desktop, but that it is not supported and that people had problems with it in the past. 

So I decided to check if there were any other ssh server implementations for Windows that did not (at least officially) force you to run ssh server as a windows service. I found freeSSHd and how to setup to run as a regular user process (non service): http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.wpi_v6/wa/6.2/FTP/WBPMv62_IEA_AdapterInstallConfigureSSHServerLab.pdf?dmuid=20090217132204643973

This actually worked almost all the way, but one problem was that I still could not actually see the tests run in the main desktop of the logged in user. I discovered that freeSSHd ran processes with the logged in user in another desktop separate from the main one, so I needed a way of peek into that desktop. I found this little gem (EnumWinstaGui): http://ikriv.com/dev/cpp/EnumWinstaGui/index.html
which lets you switch and peek into the UI of another desktop.

The only problem left was that when I needed to run Selenium Webdriver tests with the IEDriver I still could not go all the way, I solved it by setting:
capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true); when creating the WebDriver
Windows RegistryHKLM_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main path should contain key TabProcGrowth with 0 value

After this I could run all automated tests with Chrome, Firefox and IE browsers via Jenkins SSH slave and be able to peek at the running tests when needed.
Reply all
Reply to author
Forward
0 new messages