简体   繁体   中英

How do you configure TeamCity to run Selenium Tests?

I am setting a TeamCity server on Windows to run automated tests using Selenium, however, I am struggling to get Chrome to fire up from TeamCity.

I've tried using the Powershell and command line based build steps to run the nunit console application. In both instances, the tests run, but because the browser never opens up, the tests fail.

Chrome is not properly launched because when you leaved your virtual machine, you killed the remote desktop session, so there is no interactive desktop on the execution machine.

You need to exit the remote machine by executing this line of code:

for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
  %windir%\System32\tscon.exe %%s /dest:console
)

Inside a batch file to kill the remote session, but let the desktop to be active.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM