Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overlappingCheckDisabled capability #314

Open
davewood opened this issue May 29, 2017 · 7 comments
Open

overlappingCheckDisabled capability #314

davewood opened this issue May 29, 2017 · 7 comments

Comments

@davewood
Copy link

I would like to pass an option "overlappingCheckDisabled" to the selenium driver as described here: SeleniumHQ/selenium#1202 (scroll all the way down)

but "overlappingCheckDisabled" doesnt show up in the available capabilities documented here: https://metacpan.org/pod/Selenium::Remote::Driver#new

@davewood
Copy link
Author

davewood commented Jun 1, 2017

the workaround, finding and clicking the button with "execute_script" doesnt work either because i get this error:

Error while executing command: executeScriptGecko: Server returned error message Unrecognized command: POST /session/40c5c9fe-2ab0-4513-b6ce-5a20110fe735/execute/sync instead of data at /home/david/perl5/perlbrew/perls/perl-5.22.2/lib/site_perl/5.22.2/Selenium/Remote/Driver.pm line 327.

@gempesaw
Copy link
Collaborator

gempesaw commented Jun 2, 2017

It looks like that's a capability that you can express when you define your desiredCapabilities. But it also looks like (from reading that first link) it's FIrefox only?

Also, unrelated, that error you got "unrecognized command" means you should either update your geckodriver & firefox to the latest, or downgrade your selenium to the previous version. Blergh, sorry about that, hmmmmm.

@davewood
Copy link
Author

davewood commented Jun 8, 2017

Hey gempesaw, thanks for your feedback.

I am using the newest geckodriver 0.16.1 and yes, it's firefox only but im fine with that.

I can't seem to set the capability though or maybe i am using the wrong config format because I still get the same error message.

my $driver = Selenium::Firefox->new(
   marionette_enabled => 0,
   binary => "/home/david/dev/EPPlication/geckodriver",
   desired_capabilities => { overlappingCheckDisabled => 1 },
);

on a sidenote, there seems to be a bug in the error handler with that particular error:

2017-06-08 10:39:14 19620 Can't use string ("Element is not clickable at poin"...) as a HASH ref while "strict refs" in use at /home/david/perl5/perlbrew/perls/perl-5.22.2/lib/site_perl/5.22.2/Selenium/Remote/ErrorHandler.pm line 125.
 at /home/david/perl5/perlbrew/perls/perl-5.22.2/lib/site_perl/5.22.2/Selenium/Remote/Driver.pm line 327.

@teodesian
Copy link
Owner

Oh boy, that awful patch in geckodriver to emulate chromedriver behaviour but that is hilariously wrong when negative margins are used on the element. What fun!

Anyways, we've been disabling behaviour this for some time in our own code, I'll have to look up what we're doing; I'll paste it in here when I find it; but there might be something wrong here, as I do still have to click via javascript as a workaround in several tests.

@troglodyne
Copy link

The thing I do most often to get around the broken overlap detection is to send the element the 'enter' key, as 99% of the time something that is clickable responds exactly the same to the enter key being sent to the element, and that hasn't yet been kneecapped.

You can also try scroll hacks, usually some combination of scrolling the window and doing get_element_location_in_view just to force it to be scrolled where it is 'clickable' will work about 75% of the time to get rid of these problems.

Probably the best way to help test authors in this module would be to have a 'method' option you can pass into click. I'd imagine it would accept parameters something like the following:
'native' -- (default) sends a click event to the element via the official webdriver click method
'keydown' -- sends the enter key to the element
'javascript' -- clicks the element by sending a click event via 'execute_script' instead of the native method.

Then folks could just 'give up and use the workaround' when they are pulling their hair out trying to figure out why something plainly visible when watching the test execute in firefox fails to send a click event to an element that is clearly visible on the page (and that if you click it in the same browser, doesn't fail).

@teodesian
Copy link
Owner

Make it so, @troglodyne

troglodyne added a commit to troglodyne/Selenium-Remote-Driver that referenced this issue Nov 2, 2017
Still need to add tests, current unit tests all pass though
@teodesian teodesian self-assigned this Jan 9, 2018
@teodesian
Copy link
Owner

In new geckodriver this is now the webdriverClick capability. To do this, you need but pass this to constructor:

my $d = Selenium::Remote::Driver->new( extra_capabilities => { webdriverClick => 0 }, ...)

I should probably add links to the docs as to what is supported by the drivers in that section of the POD to reduce confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants