Package io.karatelabs.driver.cdp
Class CdpMouse
java.lang.Object
io.karatelabs.driver.cdp.CdpMouse
- All Implemented Interfaces:
Mouse
CDP-based implementation of mouse actions.
Uses CDP Input.dispatchMouseEvent for low-level mouse control.
Coordinates are viewport-relative.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclick()Click at the current position.Double-click at the current position.down()Press the mouse button down at the current position.dragTo(double targetX, double targetY) Drag from current position to target position.doublegetX()Get current x coordinate.doublegetY()Get current y coordinate.move(double x, double y) Move mouse to specified coordinates.offset(double dx, double dy) Move mouse by offset from current position.Right-click at the current position.scrollDown(double amount) Scroll down at the current position.scrollLeft(double amount) Scroll left at the current position.scrollRight(double amount) Scroll right at the current position.scrollUp(double amount) Scroll up at the current position.up()Release the mouse button at the current position.wheel(double deltaX, double deltaY) Perform a mouse wheel scroll.
-
Constructor Details
-
CdpMouse
-
CdpMouse
-
-
Method Details
-
move
Description copied from interface:MouseMove mouse to specified coordinates. -
offset
Description copied from interface:MouseMove mouse by offset from current position. -
click
Description copied from interface:MouseClick at the current position. -
doubleClick
Description copied from interface:MouseDouble-click at the current position.- Specified by:
doubleClickin interfaceMouse- Returns:
- this for chaining
-
rightClick
Description copied from interface:MouseRight-click at the current position.- Specified by:
rightClickin interfaceMouse- Returns:
- this for chaining
-
down
Description copied from interface:MousePress the mouse button down at the current position. -
up
Description copied from interface:MouseRelease the mouse button at the current position. -
wheel
Description copied from interface:MousePerform a mouse wheel scroll. -
scrollDown
Description copied from interface:MouseScroll down at the current position.- Specified by:
scrollDownin interfaceMouse- Parameters:
amount- the scroll amount in pixels- Returns:
- this for chaining
-
scrollUp
Description copied from interface:MouseScroll up at the current position. -
scrollRight
Description copied from interface:MouseScroll right at the current position.- Specified by:
scrollRightin interfaceMouse- Parameters:
amount- the scroll amount in pixels- Returns:
- this for chaining
-
scrollLeft
Description copied from interface:MouseScroll left at the current position.- Specified by:
scrollLeftin interfaceMouse- Parameters:
amount- the scroll amount in pixels- Returns:
- this for chaining
-
dragTo
Description copied from interface:MouseDrag from current position to target position. -
getX
public double getX()Description copied from interface:MouseGet current x coordinate. -
getY
public double getY()Description copied from interface:MouseGet current y coordinate.
-