Reputation: 153
I am using Selenium with Ruby. I have to switch between pages that require authentication. Initially I push username and password with the url.
http://username:[email protected]/page
However, after couple steps, when I am redirected to another page, there is still authentication popup again.
How would I pass username/password again?
Upvotes: 1
Views: 1028
Reputation: 29669
The authenticateUsing() method is still currently in beta but I think it will be part of Selenium 3.0, when its finally released. From Prashanth Sams's answer:
The Alert Method, authenticateUsing() lets you skip the Http Basic Authentication box.
WebDriverWait wait = new WebDriverWait(driver, 10); Alert alert = wait.until(ExpectedConditions.alertIsPresent()); alert.authenticateUsing(new UserAndPassword("USERNAME", "PASSWORD"));
Upvotes: 4