3

We have a Continuous Integration agent that runs with the identity of a non-logged-in user (non interactive) - i.e. the agent does work with sufficient Windows user credentials, but no user is "physically" logged-in to Windows and the agent run as a scheduled task with sufficient privileges.

The problem is that under these circumstances Selenium is not able to open a browser to actually run browser tests.

What could be the solution?

This guide just briefly mentions how to configure the Windows user to be able to run a browser with a non-logged-in user (using control userpasswords2) but that advice doesn't work.

To clarify, this problem is not specific to the Bamboo CI agent (referred to in the above link). It's common to all scenarios where Selenium running on behalf of a non-logged-in user would try to run a browser.

Ofer Zelig
  • 17,068
  • 9
  • 59
  • 93
  • 1
    To the person that cast a vote to close classified as _"unclear what you're asking"_: maybe you'd prefer to comment here what is it that is unclear - that would be much more helpful than just asking to close the question and have me ask a new one. – Ofer Zelig May 26 '15 at 00:54
  • Is it possible/make sense just to give more privilege to that user? – Igor Shubovych May 26 '15 at 13:47
  • @IgorShubovych which ones? if these are allowing the user to login, it's a serious security risk and specifically adressed and explained in paragraph 2 under "Phase 1: Start your image" in the link I've referred to. If these are different ones please suggest. – Ofer Zelig May 26 '15 at 23:30

1 Answers1

2

You need to have an interactive session to interact with. I believe this question on SuperUser Run interactive task even if user is not logged on Windows as well as the instructions from Atlassian you linked are the correct answer.

Once the user is set to auto-login, you need to reboot the system to cause that auto-login to occur. The recommendation in the linked question of forcing a lock after the login is a good one for security, but still provides an interactive session for the CI/Selenium to work against and without running under System with limitless privileges.

If this does not fix your problem after following all the directions and rebooting, and you have verified that the user is in-fact logged in at the time you run the CI/Selenium (typically you can check this with Remote Desktop and looking at that logged in user for the console session in Task Manager > Users tab), then there is most likely a different problem.

Community
  • 1
  • 1
Jacob S
  • 1,693
  • 1
  • 11
  • 12
  • The described actions don't work, it still fails, but to be fair and since the bounty expires very soon, I'll give it to you. Not marking the answer as accepted though as I hope to get other answers. Thanks! – Ofer Zelig Jun 03 '15 at 04:21
  • Let's start first: If you are physically logged in as the user that the CI is attempting to run under, does everything work properly? If not, I would recommend making sure that it operates properly while that user is logged in. What windows OS are you running on? Is it a shared workstation or server that users need to be logged in under a different profile? – Jacob S Jun 03 '15 at 13:07
  • When I'm logged-in it works. The non logged-in user (that Bamboo works from, due to security tightening) is the user that's not able to launch a browser. The OS is Windows 2012 but it applies to virtually every Windows version. Unrelated to users' profiles - it's a server that it's only job is to build and test (CI). – Ofer Zelig Jun 03 '15 at 23:17
  • I asked if you log in as that user, not a different user. Test it while logged in as the Bamboo user. If it still doesn't work, it is entirely a permissions issue. Also, if you had followed those instructions, the Bamboo user _should_ be logged in, which would otherwise mean that you didn't perform the instructions properly or you have otherwise created the issue with the permissions. When in doubt, reset the user permissions and change things until it stops working -- then you'll know how it broke. – Jacob S Jun 04 '15 at 00:46