Handling Browser Authentication using Selenium


Does anyone know about handling Browser Authentication using Selenium or any other tool during automation?

  • You must to post comments

EDIT in 2015:

This answer is outdated. WebDriver nowadays supports authentication! See How to handle authentication popup with Selenium WebDriver using Java

Original answer:

This is not handled very well by Selenium.

You can try using http://username:password@example.com/yourpage

instead of just http://example.com/yourpage

However, as far as I know, Firefox will still pop up a browser dialog requesting a confirmation.

You can try Robot if you’re using Java (or any similar tool like AutoIt).

You could use driver.manage().addCookie() if you’re using WebDriver.

Or a custom FirefoxProfile that has already passed the authentication once.

  • 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.