Class PointerInputDevice
- Namespace
- OpenQA.Selenium.Interactions
- Assembly
- WebDriver.dll
Represents a pointer input device, such as a stylus, mouse, or finger on a touch screen.
public class PointerInputDevice : InputDevice
- Inheritance
-
PointerInputDevice
- Inherited Members
Constructors
PointerInputDevice()
Initializes a new instance of the PointerInputDevice class.
public PointerInputDevice()
PointerInputDevice(PointerKind)
Initializes a new instance of the PointerInputDevice class.
public PointerInputDevice(PointerKind pointerKind)
Parameters
pointerKindPointerKindThe kind of pointer represented by this input device.
PointerInputDevice(PointerKind, string)
Initializes a new instance of the PointerInputDevice class.
public PointerInputDevice(PointerKind pointerKind, string deviceName)
Parameters
pointerKindPointerKindThe kind of pointer represented by this input device.
deviceNamestringThe unique name for this input device.
Exceptions
Properties
DeviceKind
Gets the type of device for this input device.
public override InputDeviceKind DeviceKind { get; }
Property Value
Methods
CreatePointerCancel()
Creates a pointer cancel action.
public Interaction CreatePointerCancel()
Returns
- Interaction
The action representing the pointer cancel gesture.
CreatePointerDown(MouseButton)
Creates a pointer down action.
public Interaction CreatePointerDown(MouseButton button)
Parameters
buttonMouseButtonThe button of the pointer that should be pressed.
Returns
- Interaction
The action representing the pointer down gesture.
CreatePointerDown(MouseButton, PointerEventProperties)
Creates a pointer down action.
public Interaction CreatePointerDown(MouseButton button, PointerInputDevice.PointerEventProperties properties)
Parameters
buttonMouseButtonThe button of the pointer that should be pressed.
propertiesPointerInputDevice.PointerEventPropertiesThe specifications for the pointer event interaction
Returns
- Interaction
The action representing the pointer down gesture.
Remarks
MouseButton value applies to Pen types for primary, secondary and erase functionality (0, 2, and 5 respectively)
CreatePointerMove(IWebElement, int, int, TimeSpan)
Creates a pointer move action to a specific element.
public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffset, TimeSpan duration)
Parameters
targetIWebElementThe IWebElement used as the target for the move.
xOffsetintThe horizontal offset from the origin of the move.
yOffsetintThe vertical offset from the origin of the move.
durationTimeSpanThe length of time the move gesture takes to complete.
Returns
- Interaction
The action representing the pointer move gesture.
Exceptions
- ArgumentNullException
If
targetis null.
CreatePointerMove(IWebElement, int, int, TimeSpan, PointerEventProperties)
Creates a pointer move action to a specific element.
public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffset, TimeSpan duration, PointerInputDevice.PointerEventProperties properties)
Parameters
targetIWebElementThe IWebElement used as the target for the move.
xOffsetintThe horizontal offset from the origin of the move.
yOffsetintThe vertical offset from the origin of the move.
durationTimeSpanThe length of time the move gesture takes to complete.
propertiesPointerInputDevice.PointerEventPropertiesThe specifications for the pointer event interaction
Returns
- Interaction
The action representing the pointer move gesture.
Exceptions
- ArgumentNullException
If
targetis null.
CreatePointerMove(CoordinateOrigin, int, int, TimeSpan)
Creates a pointer move action to an absolute coordinate.
public Interaction CreatePointerMove(CoordinateOrigin origin, int xOffset, int yOffset, TimeSpan duration)
Parameters
originCoordinateOriginThe origin of coordinates for the move. Values can be relative to the view port origin, or the most recent pointer position.
xOffsetintThe horizontal offset from the origin of the move.
yOffsetintThe vertical offset from the origin of the move.
durationTimeSpanThe length of time the move gesture takes to complete.
Returns
- Interaction
The action representing the pointer move gesture.
Exceptions
- ArgumentException
Thrown when passing CoordinateOrigin.Element into origin. Users should us the other CreatePointerMove overload to move to a specific element.
CreatePointerMove(CoordinateOrigin, int, int, TimeSpan, PointerEventProperties)
Creates a pointer move action to an absolute coordinate.
public Interaction CreatePointerMove(CoordinateOrigin origin, int xOffset, int yOffset, TimeSpan duration, PointerInputDevice.PointerEventProperties properties)
Parameters
originCoordinateOriginThe origin of coordinates for the move. Values can be relative to the view port origin, or the most recent pointer position.
xOffsetintThe horizontal offset from the origin of the move.
yOffsetintThe vertical offset from the origin of the move.
durationTimeSpanThe length of time the move gesture takes to complete.
propertiesPointerInputDevice.PointerEventPropertiesThe object containing additional properties for this pointer move operation.
Returns
- Interaction
The action representing the pointer move gesture.
Exceptions
- ArgumentException
Thrown when passing CoordinateOrigin.Element into origin. Users should use the other CreatePointerMove overload to move to a specific element.
CreatePointerUp(MouseButton)
Creates a pointer up action.
public Interaction CreatePointerUp(MouseButton button)
Parameters
buttonMouseButtonThe button of the pointer that should be released.
Returns
- Interaction
The action representing the pointer up gesture.
CreatePointerUp(MouseButton, PointerEventProperties)
Creates a pointer down action.
public Interaction CreatePointerUp(MouseButton button, PointerInputDevice.PointerEventProperties properties)
Parameters
buttonMouseButtonThe button of the pointer that should be pressed.
propertiesPointerInputDevice.PointerEventPropertiesThe specifications for the pointer event interaction
Returns
- Interaction
The action representing the pointer down gesture.
Remarks
MouseButton value applies to Pen types for primary, secondary and erase functionality (0, 2, and 5 respectively)
ToDictionary()
Returns a value for this input device that can be transmitted across the wire to a remote end.
public override Dictionary<string, object> ToDictionary()
Returns
- Dictionary<string, object>
A Dictionary<TKey, TValue> representing this action.