An overlap element was detected in the Capybara webkit driver, how can I click one of them?

Capybara webkit driver does not see my css correctly. He sees (displays) that my button overlaps another button, while the selenium driver has no problems.

Anyway, can I click on it? can a script be executed or something?

+7
ruby-on-rails webkit rspec cucumber capybara
source share
2 answers

With Capybara, you can trigger click events instead of directly clicking on such an element:

page.find("#some_element").trigger("click") 

The problem is that this does not work in Selenium. So what you can do is conditionally execute a standard capybara click or trigger("click") based on the current javascript driver, which will look something like this:

 if Capybara.javascript_driver == :selenium page.find("#some_element").click else page.find("#some_element").trigger("click") end 

Obviously, this is less than ideal, but this is the best way I've come across such situations.

+16
source share

Maybe you should try to be more specific in the way than exactly a table row instead of a row, something like:

page.find('//*[@id="row_0_table"]') #returns error

page.find('//*[@id="table_0_0"]') #works

0
source share

All Articles