Skip to content

Instantly share code, notes, and snippets.

@biske
Forked from jnicklas/template.rb
Last active December 24, 2015 12:09
Show Gist options
  • Save biske/6795415 to your computer and use it in GitHub Desktop.
Save biske/6795415 to your computer and use it in GitHub Desktop.
require "capybara"
html = DATA.read
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] }
sess = Capybara::Session.new(:selenium, app)
sess.visit("/")
puts sess.find('#id1').text
__END__
<!doctype html>
<html>
<body>
<div id='id1'>Test 1</div>
<div id='id2'>Test 2</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment