tags:

views:

847

answers:

5

I'm trying to run a simple WatIn test through TeamCity but the IExplorer window is never shown. Like it is usally through CruiseControl.

I get an error that it can't find a text field so something is running. But i can't see what with out the window.

Is there a specific setup of TeamCity server that i need to do?

+7  A: 

Found this on another forum

All credits go to Matt Baker

For future reference to anyone who attempts to run WatiN tests automatically using TeamCity. You must start your build agent using "\bin\agent.bat start" and NOT as a service. WatiN requires a full UI to execute properly and it doesn't get this environment as a service. I hope this makes it easier for other people!

Sammy Elal
Is there any chance you could elaborate on how to do this? I have a TC 4 server running with multiple builds, only one of which will be using WaTiN. Could you provide a more in-depth walk-through on how to do this?
brady gaster
this ain't true, a service can indeed use the full UI, check this answer: http://stackoverflow.com/questions/488443/running-watin-on-teamcity/3415992#3415992
Carl Hörberg
+1  A: 
  1. Stop agent service. execute command: net stop TCBuildAgent from console.
  2. Run from console c:\teamcity\buildagent\bin\agent.bat start (depending on your teamcity installation path)
ycseattle
A: 

If you installed as a service, make sure to stop it and disable it. Then, create a .bat file with the following

C:
cd teamcity\buildagent\bin\
agent.bat start

Now just create a shortcut in your start up folder to this batch file!

Manuel
+1  A: 

Can this be run without having to physically login to the server, using a Windows Scheduled Tasks for example?

peter.swallow
+1  A: 

Under Account tab on the Teamcity Agent's Service property window (service.msc), check "Allow service to interact with desktop", that will allow local service account to spawn internet explorer. But you will most certainly get stuck with other stuff, like cookie blocking, password saving etc. so login as local service and fix those stuff.

Easiest way to do that is with psexec (http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx), call psexec -i -s cmd.exe so spawn a cmd running as local account, then start internet explorer at setup everything up (the privacy settings in IE for local account is extremely high).

Carl Hörberg