Tell me more ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Our test suite is written in Python and makes use of the WebDriver Python bindings. We are looking into moving to TeamCity for continuous integration. The setup I have in mind is a build triggered for the UI tests when the source code build finishes.

The problem is that if TeamCity build agent is running as a Windows service, then the WebDriver tests are run in the background (and it takes forever to run even a single test). The workaround is to start the TeamCity build agent manually. Now the browser is visible, has focus and the tests run fine. The catch is, if the machine running the build agent is restarted, one would need to remember to start the build agent again.

Has anybody implemented a similar setup ?

How can I get around this problem of having to run the build agent manually?

share|improve this question
Have you seen "The problem is that Windows Services running as a user cannot interact with the desktop," at stackoverflow.com/questions/2291639/… ? – dzieciou Nov 15 '12 at 6:35
@testarab: "run slowly" != "takes forever", so the title now seems a bit bit misleading. Maybe the author should quantify "forever"... – dzieciou Nov 15 '12 at 13:08
@dzieciou a test which normally executes in 8 seconds now takes 1250 seconds. – user1411110 Nov 15 '12 at 18:06
The result of the test is the same? No problems with launching the browser? – dzieciou Nov 15 '12 at 18:12
The test executes successfully, but the browser is not visible, my guess is that it runs in the background (probably in a headless state ?) but as webddriver needs active browser focus it takes that long to execute. There are no problems when Teamcity build agent is started manually. – user1411110 Nov 15 '12 at 18:17

1 Answer

The two steps I had to take on a windows 7 machine were:

  1. For Win7 machines, set the registry key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\AllowRemoteRPC to 1. This allows the remote task to execute on a remote machine.
  2. Change the windows service "Interactive Service Detection" to startup "Automatic". This allows us to remote desktop in to a client machine and view a remote task being executed.

I'm able to execute selenium tests via a windows service with little delay. My test suite is using the .net libraries and all of the supported browsers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.