c# - Handling Windows authentication with Selenium Webdriver -


selenium webdriver based test in c# must login windows authentication.

i have tried couple of approaches:

  _driver.switchto().alert();   _driver.findelement(by.id("username")).sendkeys("lynntest");   _driver.findelement(by.id("password")).sendkeys("welcome1!");   _driver.switchto().alert().accept();   _driver.switchto().defaultcontent(); 

and

  ialert alert = _driver.switchto().alert();   alert.sendkeys("lynntest\\t");   alert.sendkeys("welcome1!");   _driver.switchto().alert().accept();   _driver.switchto().defaultcontent(); 

neither 1 successful. don't windows authentication dialog on local system can't view source determine how locate username , password selenium method.

i believe windows authentication dialog provided browser, haven't found source dialog.

using selenium (not autoit or other similar tools) how pass username , password windows authentication dialog? solution must based on selenium code, not add-ins, have no access browsers in cloud.

note: passing username , password in url not work, understand because dialog not generated html on page.

you can not auth window. can auth without getting window. try change url to: http://user:password@www.yourserveradress.com

if not help, need create separated profile in browser, pass authentification on server , remember password , use profile in selenium.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -