xpath - click on a image link with Capybara -
i trying click on image link capybara / rspec test. having little success @ moment.
i trying select link href "/post/3", (knowing other links before). have tried many combinations of xpath without success. combination working
page.first(:xpath, //a).click
however when have changed file , added more links above capybara test broken.
<div class='row'> <a href="/posts/3"><img id="imagen3" src="/system/posts/images/000/000/003/original/frankie-mannings-102nd-birthday-5160522641047552-hp.gif?1464448829" alt="frankie mannings 102nd birthday 5160522641047552 hp" /></a> <p>caption</p> </div>
how can select link, , click it?
ok got it: find(:xpath, "//a[contains(@href,'posts/3}')]").click
Comments
Post a Comment