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:[email protected]/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.

3
  • Please read the description of a tag before applying it to a question. The "linux" tag doesn't belong here. Commented Feb 10, 2018 at 8:51
  • Possible duplicate of Selenium - Basic Authentication via url Commented Feb 10, 2018 at 11:23
  • The above link which is mentioned as "possible duplicate", doesn't help me out, I have already tried the things mentioned in its Answers. Commented Feb 10, 2018 at 12:36

1 Answer 1

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()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.