Last Updated: February 25, 2016
·
1.56K
· arrblair

Navigate WebDriver Browser Instance Through HTTP Basic Authentication

WebDriver doesn't have the ability to interact with most things in the browser that fall outside of the DOM. Due to this limitation, HTTP Basic Authentication is a frequent stumbling block. I've often gotten past this by passing in an authorized username & password prepended to the URL.

# uses the Python bindings for Selenium WebDriver
driver = webdriver.Chrome()
driver.get("http://username:password@AuthProtectedURL")