How can I handle via a ruby script the basic auth pop up window using
gem 'selenium-webdriver', '~> 3.0'
, or switch and enter a username and password to login pop up/alert window?Is there a way to edit firefox profile and add to there url and saved logins via the script ?
Also I cant inspect from my browser the elements on the pup up/alert window in order to find the ids.
The the basic auth pop up window not from the URL in @driver.get 'url'
in my script, first I go to a different website, then click on some link and I got this basic auth pop-up window.
It works when I type manually the user/pass from my browser.
I got exception when I tried to do something like this:
a = @driver.switch_to.alert
a.send_keys("username")
caught exception Missing 'value' parameter!
Screenshot from Chrome
-
Screenshot from Firefox
-
This way @driver.get 'https://username:password@mysite.com/mypage/'
doesn't work so well, its send me back to the login page, and pop up another window:
You are about to log in to the site “launchpad.support.sap.com” with the username “username”, but the website does not require authentication. This may be an attempt to trick you. Is “launchpad.support.sap.com” the site you want to visit?
I found some solutions in java but nothing in ruby :(
Any help would be appreciated,
Thanks!