Last active
December 18, 2015 08:09
-
-
Save abotalov/5752462 to your computer and use it in GitHub Desktop.
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
require "capybara" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
sess.find(:xpath,"//a[contains(text(),'Foo')]").click # Element looks like clicked after that | |
sleep 3 | |
__END__ | |
<!doctype html> | |
<div id="content"> | |
<div id="left"> | |
<div id="navigation"> | |
<ul id="menu"> | |
<li class="firstdrop"> | |
<div>System</div> | |
<ul class="subdrop"> | |
<li><a href="/foo.php" class="navlnk">Foo</a></li> | |
<li><a href="/bar.php" class="navlnk">Bar</a></li> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment