Selenium / Protractor fails to run browser tests (E2E) if the user running it is not interactively logged in

We have a continuous integration agent that runs with an unclaimed user id (non-interactive) - that is, the agent does indeed run with sufficient Windows user credentials, but no user is "physically" connected to Windows and the agent runs as a scheduled task with sufficient privileges ...

The problem is that under these conditions Selenium cannot open the browser to actually run browser tests.

What could be the solution?

This tutorial briefly mentions how to set up a Windows user so that they can launch a browser with a user without logging in (using control userpasswords2

), but this tip doesn't work.

To clarify, this issue is not specific to the Bamboo CI agent (mentioned in the link above). It is common to all scenarios in which Selenium runs as a non-logged user and will try to launch the browser.

+3


source to share


1 answer


You must have an interactive session to interact. I believe this question on SuperUser Runs an interactive task even if the user is not logged into Windows , and the correct answers from Atlassian that you linked.

After the user is configured for automatic login, you need to reboot the system to trigger automatic login. The recommendation in the related question about forcing a lock after login is good for security, but still provides an interactive session for CI / Selenium to run and not run on a system with unlimited privileges.



If this does not fix the problem after following all the prompts and rebooting and you have confirmed that the user is logged in at the time CI / Selenium is started (you can generally check this with Remote Desktop and looking at the logged in user for the console session in the task manager > Users tab), then there will most likely be a different problem.

+2


source







All Articles