Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Capybara w/ Selenium, how would I click a table row?

Would simply like to know if there's an alternative to click_link / click_button that can be used with any element as some of my clickable elements are not standard html clickables such as tr elements, but they still contain href attributes.

Javascript enabled.

like image 208
fivetwentysix Avatar asked Dec 05 '25 18:12

fivetwentysix


1 Answers

Use Javascript then:

page.execute_script("$('whatever_you_want').click()");
like image 120
Nerian Avatar answered Dec 08 '25 08:12

Nerian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!