Skip to content

Instantly share code, notes, and snippets.

@twalpole
Created May 11, 2018 23:13
Show Gist options
  • Save twalpole/fddb639fd928ee60cb6f76497127a00d to your computer and use it in GitHub Desktop.
Save twalpole/fddb639fd928ee60cb6f76497127a00d to your computer and use it in GitHub Desktop.
require "selenium/webdriver"
require "capybara/dsl"
html = DATA.read
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] }
sess = Capybara::Session.new(:selenium_chrome, app)
sess.visit('/')
sess.find('input[name="authorization"]')
__END__
<!doctype html>
<html>
<head>
<title>Some title</title>
</head>
<body>
<label>
<span>
<input value="false" name="authorization" type="checkbox">
</span>
</label>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment