Karma fails to launch IE on Team City build

ぃ、小莉子 提交于 2019-12-02 07:01:19

The issue was that IE had never been run under the service account we use for the Team City agent. It was getting stuck on the IE options dialog that opens when the browser is first run. Once I ran IE and accepted the default settings it runs on the build server:

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
[09:58:42]INFO [launcher]: Starting browser Chrome
[09:58:42]INFO [launcher]: Starting browser Firefox
[09:58:42]INFO [launcher]: Starting browser IE
[09:59:02]INFO [Firefox 38.0.0 (Windows 7 0.0.0)]: Connected on socket 1uAt8J2B8NPFj66W8Mib with id 61577635
[09:59:02]INFO [IE 11.0.0 (Windows 7 0.0.0)]: Connected on socket RPZgBEUhUGW2wD2h8Mic with id 95872295
[09:59:07]INFO [Chrome 43.0.2357 (Windows 7 0.0.0)]: Connected on socket mZzpKwFkIPpGY3vC8Mid with id 7944928
[09:59:08]Chrome 43.0.2357 (Windows 7 0.0.0)
[09:59:08]Firefox 38.0.0 (Windows 7 0.0.0)
[09:59:08]IE 11.0.0 (Windows 7 0.0.0)
[09:59:08]Process exited with code 0

@Kevin Kuszyk, your solution worked for me as well.

The problem is that Internet Explorer 11 shows a dialog window the first time it's started for each user that starts it.

Solution: Manually start IE as the TeamCity user.

In order to start Internet Explorer as the service user that you configured to run TeamCity, shift + right click on IE and select run as different user in the menu. A login bar window will show - Login and proceed. When you have logged in, the the browser will start and prompt you with a dialog. Choose the option you want and proceed (Hint, disable the security). The next time you start Internet Explorer as that user the dialog will not be shown and therefore Karma will be able to run its test suite.

If you run TeamCity as local system, it's a little bit trickier, as you have to download psexec from Microsoft and then execute the following command in powershell to start Internet Explorer:

psexec -sid "C:\Program Files\Internet Explorer\iexplore.exe"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!