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
pointerKind
PointerKindThe 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
pointerKind
PointerKindThe kind of pointer represented by this input device.
deviceName
stringThe unique name for this input device.
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
button
MouseButtonThe 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
button
MouseButtonThe button of the pointer that should be pressed.
properties
PointerInputDevice.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
target
IWebElementThe IWebElement used as the target for the move.
xOffset
intThe horizontal offset from the origin of the move.
yOffset
intThe vertical offset from the origin of the move.
duration
TimeSpanThe length of time the move gesture takes to complete.
Returns
- Interaction
The action representing the pointer move gesture.
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
target
IWebElementThe IWebElement used as the target for the move.
xOffset
intThe horizontal offset from the origin of the move.
yOffset
intThe vertical offset from the origin of the move.
duration
TimeSpanThe length of time the move gesture takes to complete.
properties
PointerInputDevice.PointerEventPropertiesThe specifications for the pointer event interaction
Returns
- Interaction
The action representing the pointer move gesture.
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
origin
CoordinateOriginThe origin of coordinates for the move. Values can be relative to the view port origin, or the most recent pointer position.
xOffset
intThe horizontal offset from the origin of the move.
yOffset
intThe vertical offset from the origin of the move.
duration
TimeSpanThe 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
origin
CoordinateOriginThe origin of coordinates for the move. Values can be relative to the view port origin, or the most recent pointer position.
xOffset
intThe horizontal offset from the origin of the move.
yOffset
intThe vertical offset from the origin of the move.
duration
TimeSpanThe length of time the move gesture takes to complete.
properties
PointerInputDevice.PointerEventPropertiesThe object containing additional proprties 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 us the other CreatePointerMove overload to move to a specific element.
CreatePointerUp(MouseButton)
Creates a pointer up action.
public Interaction CreatePointerUp(MouseButton button)
Parameters
button
MouseButtonThe 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
button
MouseButtonThe button of the pointer that should be pressed.
properties
PointerInputDevice.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.