Skip to content

Instantly share code, notes, and snippets.

@alishutc
Created March 15, 2012 12:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alishutc/2044085 to your computer and use it in GitHub Desktop.
Save alishutc/2044085 to your computer and use it in GitHub Desktop.
Login in using HTTP basic authentication with Capybara selenium driver
def login(username, password)
page.visit("http://#{username}:#{password}@#{page.driver.rack_server.host}:#{page.driver.rack_server.port}/")
end
@pedz
Copy link

pedz commented Dec 25, 2012

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.

@kofronpi
Copy link

@patrickespake your link is dead and information about another way to do could be useful ! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment