click
Click on an element.
Note: This issues a WeDdriver click
command for the selected element, which generally scrolls to and then clicks the
selected element. However, if you have fixed-position elements (such as a fixed header or footer) that cover up the
selected element after it is scrolled within the viewport, the click will be issued at the given coordinates, but will
be received by your fixed (overlaying) element. In these cased the following error is thrown:
To work around this, try to find the overlaying element and remove it via execute
command so it doesn't interfere
the click. You also can try to scroll to the element yourself using scroll
with an offset appropriate for your
scenario.
#
Usage#
ParametersName | Type | Details |
---|---|---|
options optional | ClickOptions | click options (optional) |
options.button optional | string , number | can be one of [0, "left", 1, "middle", 2, "right"] (optional) |
options.x optional | number | Number (optional) |
options.y optional | number | Number (optional) |
#
Examplesexample.html
click.js
example.js
example.html
example.js
example.html
example.js