c# - Selenium Chrome 60 Headless Handle Basic Authentication SAML Dialog over HTTPS -


chrome 59 removed support https://user:password@example.com urls.

i have c# selenium test needs work chrome version 60 on windows in 'headless' mode

        chromeoptions options = new chromeoptions();         options.addargument("headless");         driver = new chromedriver(chrome, options); 

here saml authentication required dialog trying handle on windows: basic auth dialog

based on answer given here: how handle authentication popup selenium webdriver using java) can see several workarounds handling in firefox, nothing chrome 60 in headless mode.

i've tried following code visiting url credentials before visiting url under test (without credentials) appears there bug chrome 60.

goto("http://user:password@localhost"); // caches auth, page blocked goto("http://localhost"); // uses cached auth, page renders fine // continue test normal 

i can see following code in firefox handles authentication , dialog never pops up: firefoxprofile profile = new firefoxprofile(); profile.setpreference("network.automatic-ntlm-auth.trusted-uris", "https://saml.domain.com"); profile.enablenativeevents = false;

i've tried second approach (using autoit) , works on chrome 60 not work on chrome 60 in headless mode.

        //use autoit wait 4 seconds authentication required dialog appear         au3.sleep(4000);         //use autoit send in credentials app.config encrypted         au3.send(username + "{tab}" + password + "{enter}");         //refresh page         driver.navigate().refresh(); 

i hoping there better solution in 2017 , there approach work chrome 60 in headless mode, pointers?

just clear: trying use embedded credentials not work using chrome v59+ because sub-resource requests blocked.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -