Created
March 15, 2012 12:59
-
-
Save alishutc/2044085 to your computer and use it in GitHub Desktop.
Login in using HTTP basic authentication with Capybara selenium driver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def login(username, password) | |
page.visit("http://#{username}:#{password}@#{page.driver.rack_server.host}:#{page.driver.rack_server.port}/") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much.
I figured out that user:pass@host was going to work but didn't know how to get theo host and port out of the test rig.