Skip to content

Instantly share code, notes, and snippets.

@biske
Created September 30, 2013 10:47
Show Gist options
  • Save biske/6762097 to your computer and use it in GitHub Desktop.
Save biske/6762097 to your computer and use it in GitHub Desktop.
require 'capybara/dsl'
require 'selenium-webdriver'
Capybara.run_server = false
Capybara.default_driver = :selenium
html_string = "<html>
<body>
<div id='foo'></div>
</body>
</html>"
class Robot
include Capybara::DSL
def go
capybara << html
puts find("#foo").text
end
end
r = Robot.new
r.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment