How to override basic authentication in selenium2 with Java using chrome driver?

0
0

How to override basic authentication in selenium2 chrome driver?
I am facing an issue in my project where chrome “Authentication required” popup is coming which is blocking webdriver to continue navigation.
Please find the attached screenshot for the same.
enter image description here
I am using following code to instantiate chrome driver,

private WebDriver driver;
@Override
protected void setUp() throws Exception {
super.setUp();
System.setProperty("webdriver.chrome.driver", "C:/Selenium/chromedriver.exe");
driver
= new ChromeDriver();
}
@Override
protected void tearDown() throws Exception {
// TODO Auto-generated method stub
super.tearDown();
}

Could you please help –

Thanks,

  • You must to post comments
0
0

I think you’re talking about using NTLM Authentication (windows integrated authentication) not Basic Authentication (where you provider your credentials in URL). Assuming that here is what you can try for running NTML auth in chrome:

Approach 1

Go to Internet Explorer, and open “Internet Options”. Follow following steps:

  • Add your site to either Local intranet or Trusted sites add
  • List item
  • List item
  • List item
  • List item

After these changes, your chrome authentication should work. If you’re wondering that how IE settings effect chrome behavior then, Chrome uses IE security settings for authentication.

Some good resources / credits:

  1. Good details
  2. Selenium issue details

Approach 2

Add your site to Local intranet and don’t change anything for user authentication. By default, second option (Automatic logon only in Intranet sites) is selected.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website