cuprite icon indicating copy to clipboard operation
cuprite copied to clipboard

Capybara::NotSupportedByDriverError (Capybara::Driver::Node#rect)

Open Nakilon opened this issue 1 year ago • 3 comments

In autotesting at my job they use firefox/webdriver since the ice age, and I want to make us use chrome/cdp. After writing some tests under the old framework I got used to the rect method, but I should make more tests under the new framework to make them see that all the stack became better, but I immediately stumble upon:

Capybara::NotSupportedByDriverError (Capybara::Driver::Node#rect)

Is this a cuprite's responsibility to implement this method? What is the workaround while it's not fixed? getBoundingClientRect? Which class should I patch?

UPD: or is it only methods which throw the NotImplementedError that cuprite should define? I don't really get the difference in the capybara source code.

Nakilon avatar Oct 02 '24 13:10 Nakilon

Is this a cuprite's responsibility to implement this method? What is the workaround while it's not fixed? getBoundingClientRect? Which class should I patch?

co-asking as well.

we are currently trying to migrate from selenium to cuprite and we are using this method in one of our tests

4tolexx avatar Nov 15 '24 09:11 4tolexx

Found this while looking up the same issue 😁

For now I'm working around it with code like:

page.evaluate_script("document.querySelector('#{selector}').getBoundingClientRect().x").floor

duncan-bayne avatar Mar 17 '25 22:03 duncan-bayne

@Nakilon Would you like to set the same avatar on github as on stackoverflow? https://stackoverflow.com/users/322020/nakilon

Image

fatkodima avatar Jul 02 '25 10:07 fatkodima