Selenium Chrome Addon
Chrome addon webextension to test websites with Basic Authentication using Selenium
Usage:
- Inspect (F12) the request in Network Tab of Developer tools
- Look fo the Authorization code in the Request Headers like below
GET /basic-auth/user/passwd HTTP/1.1 Host: httpbin.org Connection: keep-alive Authorization: Basic dXNlcjpwYXNzd2Q=
- Clone or Download the Repo to a folder
- Edit the
background.js
and insert the Authorization code in the line no:4details.requestHeaders.push({name: "Authorization",value: "Basic dXNlcjpwYXNzd2Q="});
- Modify the Selenium code with the same folder
from selenium import webdriver
# Set Chrome options.
options = webdriver.ChromeOptions()
# Modify the path of the folder
options.add_argument('--load-extension=path/to/the/extension/folder')
driver = webdriver.Chrome(chrome_options=options)
driver.get('https://httpbin.org/basic-auth/user/passwd')
# Your Code goes here...
driver.quit()