0

python selenium stack

I have a very specific problem when trying to use default Selenium auth using this construction: <username:password@siteurl.com>

Need to run UI tests in headless mode

The main problem is that this HTTP Basic Authentication is needed to go to the iframe and has a different URL compared to the main page. That is, I first need to go to the main page, and then go from this page to an iframe, when going to which HTTP Basic Authentication is required

When using this authentication, I get an error on the site "Application error: a client-side exception has occurred (see the browser console for more information)."

I tried all sorts of options, including:

1\.
username = "%21%40user" #stands for !@user
password = "%0D%0Apass" #stands for ^&pass
webpage="something.url.com"
url = 'http://{}:{}@{}'.format(username, password, webpage)
driver.get(url)\`
2\.
Doesn't work in headless mode
SendKeys("myUser");
SendKeys("{TAB}");
SendKeys("MyPassword");
SendKeys("\~"); // Enter
3\.
Doesn't work in headless mode
pyautogui.write(login)
pyautogui.press('tab')
pyautogui.write(password)
pyautogui.press('enter')

Please tell me how can I solve this. problem.

I need to be authenticated to access my iFrame in headless mode

Sergy
  • 1
  • When something doesn't work in headless mode, but does work in regular mode, then use the new headless mode on Chrome: https://stackoverflow.com/a/73840130/7058266 – Michael Mintz May 02 '23 at 12:43

0 Answers0