1

I'm trying to run IE as a different user in my Selenium tests. Any idea how I can tell Selenium Webdriver to "run as" a specified user?

SB2055
  • 12,272
  • 32
  • 97
  • 202
  • 1
    what version of Windows are you running? – Ewan May 16 '13 at 14:35
  • Windows 8 locally and Server 2010 on the build server – SB2055 May 16 '13 at 14:43
  • Could we have more information on your set up please? i.e. are you trying to run as a different user on your local machine or on the server? How do you call the Webdriver? Does it start up as part of the build or is it always running? – Ewan May 16 '13 at 14:46
  • I'm trying to run as a different user in a different domain on both machines. Webdriver is called from a test class in C#. It starts as part of the build. – SB2055 May 16 '13 at 14:52

1 Answers1

-1

Okay I think what you're looking for is this article on .NET (C#) Impersonation with Network Credentials.

You use the wrapper class as identified there to call your test class which should spawn your webdriver using the domain and user you provide.

There are some "gotchas" though and you should be aware of all security best practices that you can find under Understanding Impersonation.

Ewan
  • 14,592
  • 6
  • 48
  • 62