Package com.microsoft.playwright
Class Page.ClickOptions
- java.lang.Object
-
- com.microsoft.playwright.Page.ClickOptions
-
-
Field Summary
Fields Modifier and Type Field Description MouseButton
button
Defaults toleft
.Integer
clickCount
defaults to 1.Double
delay
Time to wait betweenmousedown
andmouseup
in milliseconds.Boolean
force
Whether to bypass the actionability checks.List<KeyboardModifier>
modifiers
Modifier keys to press.Boolean
noWaitAfter
Deprecated.This option will default totrue
in the future.Position
position
A point to use relative to the top-left corner of element padding box.Boolean
strict
When true, the call requires selector to resolve to a single element.Double
timeout
Maximum time in milliseconds.Boolean
trial
When set, this method only performs the actionability checks and skips the action.
-
Constructor Summary
Constructors Constructor Description ClickOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Page.ClickOptions
setButton(MouseButton button)
Defaults toleft
.Page.ClickOptions
setClickCount(int clickCount)
defaults to 1.Page.ClickOptions
setDelay(double delay)
Time to wait betweenmousedown
andmouseup
in milliseconds.Page.ClickOptions
setForce(boolean force)
Whether to bypass the actionability checks.Page.ClickOptions
setModifiers(List<KeyboardModifier> modifiers)
Modifier keys to press.Page.ClickOptions
setNoWaitAfter(boolean noWaitAfter)
Deprecated.This option will default totrue
in the future.Page.ClickOptions
setPosition(double x, double y)
A point to use relative to the top-left corner of element padding box.Page.ClickOptions
setPosition(Position position)
A point to use relative to the top-left corner of element padding box.Page.ClickOptions
setStrict(boolean strict)
When true, the call requires selector to resolve to a single element.Page.ClickOptions
setTimeout(double timeout)
Maximum time in milliseconds.Page.ClickOptions
setTrial(boolean trial)
When set, this method only performs the actionability checks and skips the action.
-
-
-
Field Detail
-
button
public MouseButton button
Defaults toleft
.
-
clickCount
public Integer clickCount
defaults to 1. See [UIEvent.detail].
-
delay
public Double delay
Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
-
force
public Boolean force
Whether to bypass the actionability checks. Defaults tofalse
.
-
modifiers
public List<KeyboardModifier> modifiers
Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows and Linux and to "Meta" on macOS.
-
noWaitAfter
public Boolean noWaitAfter
Deprecated.This option will default totrue
in the future.
-
position
public Position position
A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
-
strict
public Boolean strict
When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
-
timeout
public Double timeout
Maximum time in milliseconds. Defaults to30000
(30 seconds). Pass0
to disable timeout. The default value can be changed by using theBrowserContext.setDefaultTimeout()
orPage.setDefaultTimeout()
methods.
-
trial
public Boolean trial
When set, this method only performs the actionability checks and skips the action. Defaults tofalse
. Useful to wait until the element is ready for the action without performing it. Note that keyboardmodifiers
will be pressed regardless oftrial
to allow testing elements which are only visible when those keys are pressed.
-
-
Method Detail
-
setButton
public Page.ClickOptions setButton(MouseButton button)
Defaults toleft
.
-
setClickCount
public Page.ClickOptions setClickCount(int clickCount)
defaults to 1. See [UIEvent.detail].
-
setDelay
public Page.ClickOptions setDelay(double delay)
Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
-
setForce
public Page.ClickOptions setForce(boolean force)
Whether to bypass the actionability checks. Defaults tofalse
.
-
setModifiers
public Page.ClickOptions setModifiers(List<KeyboardModifier> modifiers)
Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows and Linux and to "Meta" on macOS.
-
setNoWaitAfter
public Page.ClickOptions setNoWaitAfter(boolean noWaitAfter)
Deprecated.This option will default totrue
in the future.
-
setPosition
public Page.ClickOptions setPosition(double x, double y)
A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
-
setPosition
public Page.ClickOptions setPosition(Position position)
A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
-
setStrict
public Page.ClickOptions setStrict(boolean strict)
When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
-
setTimeout
public Page.ClickOptions setTimeout(double timeout)
Maximum time in milliseconds. Defaults to30000
(30 seconds). Pass0
to disable timeout. The default value can be changed by using theBrowserContext.setDefaultTimeout()
orPage.setDefaultTimeout()
methods.
-
setTrial
public Page.ClickOptions setTrial(boolean trial)
When set, this method only performs the actionability checks and skips the action. Defaults tofalse
. Useful to wait until the element is ready for the action without performing it. Note that keyboardmodifiers
will be pressed regardless oftrial
to allow testing elements which are only visible when those keys are pressed.
-
-