0

Does anyone know how to handle the browser authentication popup(corporate web policy) using selenium webdriver in google chrome? Note: I am using Linux-Cent OS 7. I tried using the "http://username:password@example.com/yourpage", and automating using AutoIT, but since it is linux OS, AutoIt doesnt work. No error logs are generated.

Details are as follows: OS: Linux - Cent OS-7. Google Chrome version: 62 Selenium-Java version: 3.9.0

Thanks.

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55

1 Answers1

1

I still don't know how to handle the browser authentication popup with Chrome (In my case, I am using Chrome 63). I could solve it with Firefox:

import time

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
driver.get('https://<host>:<port>/<something>')
alert = driver.switch_to.alert
alert.send_keys('<username>' + Keys.TAB + '<password>')
alert.accept()
time.sleep(5)
print(driver.title)
driver.quit()
brunabxs
  • 31
  • 3