Hardik Patel
Hardik Patel

Reputation: 212

How to automate "Authentication required" pop up in Opera 12.x with Selenium webdriver

I am trying to get opera to login to a local page that requires a username and password. I have tried the 2 different ways i know

private static String URL = "http://username:[email protected]"; //works with Firefox and Chrome

-using the robot class, works with IE.

but now i am having trouble with getting selenium 2.43.1 to login to the page.

Upvotes: 0

Views: 568

Answers (1)

Prashanth Sams
Prashanth Sams

Reputation: 21129

If you are facing Basic authentication issues, try authenticateUsing() method.

The Alert Method, authenticateUsing() lets you bypass the Http Basic Authentication box.

WebDriverWait wait = new WebDriverWait(driver, 10);
Alert alert = wait.until(ExpectedConditions.alertIsPresent());
alert.authenticateUsing(new UserAndPassword("USERNAME", "PASSWORD"));

Upvotes: 1

Related Questions