0

There are lots of variations of this question/problem and it seems like this something that a lot struggle with. At a high level, I am trying to hit a site that uses IWA for auth. In more detail, we are trying to hit the site from a test VM. The test VM does not have a user logged in, so when the browser is opened by selenium or another driver, there is no IWA authenticated user. The session just times out each time.

I have tried for almost 2 weeks now and can't find a solution. Things that we have tried.

  1. Opening the browser as a specific Chrome prolile (this doesn't seem even remotely possible, but I still tried it unsuccessuflly)
  2. Enabling impersonation in IIS/Web.config and granting the permissions to this domain user (site still opens as no user using selenium, or opens as my account if I RDP to the box)
  3. Disabling auth in the application, but that goes against what flows/features that we'd like to test
  4. enabling and using proces.start in the selenium project but errors would arise about permissions creating folders on the VM
  5. Auto login with AD account when VM boots up but domain GPO blocks that

From being very new to this and only troubleshooting for a couple weeks, that the approach should be somehow in the test project be able to login as that test user and open the browser/url. I just have not found out how to do that.

What is the best approach when in this situation? Is it possible to have a selenium/C# solution run on a windows machine and initiate a login? If that is even possible, could you pass that to the chrome driver and then the browser?

GIZNAJ
  • 501
  • 5
  • 23
  • The browser should display a login prompt, in this case. Does this give you any guidance? [How to handle login pop up window using Selenium WebDriver?](https://stackoverflow.com/q/11522434/3092298) – Greg Burghardt Nov 06 '19 at 18:06
  • No, that is not good. First off, the application is not supporting that. So we would have to enable that and Selenium can NOT work with Windows Prompts (the user/pass prompt is a windows control) – GIZNAJ Nov 06 '19 at 19:03
  • I would run Selenium from a machine logged in to the domain. If you have to use a VM, you'd need to add that VM to the domain, no? – pcalkins Nov 06 '19 at 23:01
  • @pcalkins - that sounds this is the desired or easiest solution. The only problem is when we got to PaaS and use Azure VM's to run the tests, how would those be joined to a domain? They are built up, run the tests and torn down immediately. There is no concept of a Domain for a Azure Test/Build agent. Thanks for the reply – GIZNAJ Nov 07 '19 at 13:52
  • maybe look at this: https://learn.microsoft.com/en-us/azure/active-directory-domain-services/join-windows-vm#join-the-vm-to-the-azure-ad-ds-managed-domain (I've never done this before...) – pcalkins Nov 07 '19 at 20:24

0 Answers0