Handling Browser Authentication using Selenium

authentication, automation, browser, selenium

Solution

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.

Problem

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

Original source

Related problems