Class
UserInteraction

UI interaction class that allows you to interact with DesktopControl directly using real mouse and keyboard interactions

Definition

Namespace:ArtOfTest.WebAii.DesktopAutomation

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class UserInteraction

Inheritance: objectUserInteraction

Methods

Click()

Click this control by moving the mouse to it and click it.

Declaration

cs-api-definition
public void Click()

Click(MouseClickType)

Click this control by moving the mouse to it and click it.

Declaration

cs-api-definition
public void Click(MouseClickType clickType)

Parameters

clickType

MouseClickType

The mouse click type to use.

Click(MouseClickType, Point)

Click this control by moving the mouse to it and click it.

Declaration

cs-api-definition
public void Click(MouseClickType clickType, Point offsetPoint)

Parameters

clickType

MouseClickType

The mouse click type to use.

offsetPoint

Point

The offset point to use from the TopLeft corner of the control

Click(MouseClickType, Point, OffsetReference)

Click this control by moving the mouse to it and click it.

Declaration

cs-api-definition
public void Click(MouseClickType clickType, Point offsetPoint, OffsetReference reference)

Parameters

clickType

MouseClickType

The mouse click type to use.

offsetPoint

Point

The offset point to use from the reference specified of the control

reference

OffsetReference

The desired reference point to use to calculate the offset

Click(MouseClickType, int, int, OffsetReference)

Click this control by moving the mouse to it and click it.

Declaration

cs-api-definition
public void Click(MouseClickType clickType, int x, int y, OffsetReference reference)

Parameters

clickType

MouseClickType

The mouse click type to use.

x

int

The X-coordinate of the offset point to use

y

int

The Y-coordinate of the offset point to use

reference

OffsetReference

The desired reference point to use to calculate the offset

Click(MouseClickType, int, int, OffsetReference, ActionPointUnitType)

Click this control by moving the mouse to it and click it.

Declaration

cs-api-definition
public void Click(MouseClickType clickType, int x, int y, OffsetReference reference, ActionPointUnitType unitType)

Parameters

clickType

MouseClickType

The mouse click type to use.

x

int

The X-coordinate of the offset point to use

y

int

The Y-coordinate of the offset point to use

reference

OffsetReference

The desired reference point to use to calculate the offset

unitType

ActionPointUnitType

X and Y unit type.

Click(MouseClickType, int, int, OffsetReference, ActionPointUnitType, Keys)

Click this control by moving the mouse to it and click it.

Declaration

cs-api-definition
public void Click(MouseClickType clickType, int x, int y, OffsetReference reference, ActionPointUnitType unitType, Keys modifierKeys)

Parameters

clickType

MouseClickType

The mouse click type to use.

x

int

The X-coordinate of the offset point to use

y

int

The Y-coordinate of the offset point to use

reference

OffsetReference

The desired reference point to use to calculate the offset

unitType

ActionPointUnitType

The units in which the X and Y coordinates are specified

modifierKeys

Keys

Combination of modifier keys to hold while clicking

ClickPoint(MouseClickType, Point)

Click an absolute point on the screen.

Declaration

cs-api-definition
public void ClickPoint(MouseClickType clickType, Point absolutePoint)

Parameters

clickType

MouseClickType

The mouse click type to use.

absolutePoint

Point

The absolute point to click

ClickPoint(Point)

Click an absolute point on the screen.

Declaration

cs-api-definition
public void ClickPoint(Point absolutePoint)

Parameters

absolutePoint

Point

The point to click.

DetectHotSpot(int)

Get the hot spot within this element that causes the mouse to change shape.

Declaration

cs-api-definition
public Point DetectHotSpot(int searchRadius)

Parameters

searchRadius

int

The search radius from the center point of this element.

Returns

Point

The target point.

DetectHotSpot(int, Cursor)

Get the hot spot within this element that causes the mouse to change to the specified cursor

Declaration

cs-api-definition
public Point DetectHotSpot(int searchRadius, Cursor cursor)

Parameters

searchRadius

int

The search radius from the center point of this element.

cursor

Cursor

The cursor to check.

Returns

Point

The target point.

DragTo(DesktopElement)

Drag this element from its center to the center of the dropTarget

Declaration

cs-api-definition
public void DragTo(DesktopElement dropTarget)

Parameters

dropTarget

DesktopElement

The drop target element

DragTo(int, int)

Drag this element from its center to the x,y offset.

Declaration

cs-api-definition
public void DragTo(int x, int y)

Parameters

x

int

The x offset from the center.

y

int

The y offset from the center.

DragTo(int, int, OffsetReference, ActionPointUnitType, DesktopElement, int, int, OffsetReference, ActionPointUnitType, bool)

Drag this element to the dropTarget

Declaration

cs-api-definition
public void DragTo(int startOffsetX, int startOffsetY, OffsetReference startOffsetReference, ActionPointUnitType startUnitType, DesktopElement dropTarget, int endOffsetX, int endOffsetY, OffsetReference endOffsetReference, ActionPointUnitType endUnitType, bool skipValidateDropLocation)

Parameters

startOffsetX

int

The horizontal offset within this element from which to begin the drag

startOffsetY

int

The vertical offset within this element from which to begin the drag

startOffsetReference

OffsetReference

The reference used to calculate the offsets within this element

startUnitType

ActionPointUnitType

dropTarget

DesktopElement

The drop target element

endOffsetX

int

The horizontal offset within the drop target at which to end the drag

endOffsetY

int

The vertical offset within the drop target at which to end the drag

endOffsetReference

OffsetReference

The reference used to calculate the offsets within the drop target element

endUnitType

ActionPointUnitType

skipValidateDropLocation

bool

Whether to skip validation of the drop location

DragTo(int, int, OffsetReference, DesktopElement, int, int, OffsetReference)

Drag this element to the dropTarget

Declaration

cs-api-definition
public void DragTo(int startOffsetX, int startOffsetY, OffsetReference startOffsetReference, DesktopElement dropTarget, int endOffsetX, int endOffsetY, OffsetReference endOffsetReference)

Parameters

startOffsetX

int

The horizontal offset within this element from which to begin the drag

startOffsetY

int

The vertical offset within this element from which to begin the drag

startOffsetReference

OffsetReference

The reference used to calculate the offsets within this element

dropTarget

DesktopElement

The drop target element

endOffsetX

int

The horizontal offset within the drop target at which to end the drag

endOffsetY

int

The vertical offset within the drop target at which to end the drag

endOffsetReference

OffsetReference

The reference used to calculate the offsets within the drop target element

DragTo(int, int, bool)

Perform a drag to with an auto detection option of the hot spot.

Declaration

cs-api-definition
public void DragTo(int x, int y, bool autoDetectStartHotSpot)

Parameters

x

int

The x offset from the center.

y

int

The y offset from the center.

autoDetectStartHotSpot

bool

Whether to auto-detect the hot spot at the start of the drag or no.

Remarks

The function uses mouse cursor change (from default cursor) to detect the hot spot. If the hot spot does not change the mouse when over it, this function will not be able to detect the spot. This function uses a 10 pixel range to scan for hotspots from the center point of this element.

DragTo(int, int, bool, Cursor, int)

Perform a drag to with an auto detection option of the hot spot.

Declaration

cs-api-definition
public void DragTo(int x, int y, bool autoDetectStartHotSpot, Cursor hotSpotCursor, int radius)

Parameters

x

int

The x offset from the center.

y

int

The y offset from the center.

autoDetectStartHotSpot

bool

Whether to auto-detect the hot spot at the start of the drag or no.

hotSpotCursor

Cursor

A specific cursor to check for as the hot spot indicator

radius

int

The search radios from the center point of the source element.

Remarks

The function uses mouse cursor change to detect the hot spot. If the hot spot does not change the mouse, this function will not be able to detect the spot

DragTo(int, int, bool, Cursor, int, bool)

Perform a drag to with an auto detection option of the hot spot.

Declaration

cs-api-definition
public void DragTo(int x, int y, bool autoDetectStartHotSpot, Cursor hotSpotCursor, int radius, bool skipValidateDropLocation)

Parameters

x

int

The x offset from the center.

y

int

The y offset from the center.

autoDetectStartHotSpot

bool

Whether to auto-detect the hot spot at the start of the drag or no.

hotSpotCursor

Cursor

A specific cursor to check for as the hot spot indicator

radius

int

The search radios from the center point of the source element.

skipValidateDropLocation

bool

Whether to skip validation of the drop location

Remarks

The function uses mouse cursor change to detect the hot spot. If the hot spot does not change the mouse, this function will not be able to detect the spot

DragTo(int, int, int, int, OffsetReference)

Drag this element from a specified offset

Declaration

cs-api-definition
public void DragTo(int x, int y, int xOffset, int yOffset, OffsetReference offsetRef)

Parameters

x

int

The number of pixels to drag the element horizontally

y

int

The number of pixels to drag the element vertically

xOffset

int

The horizontal offset within the element's rectangle from which to begin the drag

yOffset

int

The vertical offset within the element's rectangle from which to begin the drag

offsetRef

OffsetReference

The reference used to calculate the offsets within the element

DragTo(int, int, int, int, OffsetReference, bool)

Drag this element from a specified offset

Declaration

cs-api-definition
public void DragTo(int x, int y, int xOffset, int yOffset, OffsetReference offsetRef, bool skipValidateDropLocation)

Parameters

x

int

The number of pixels to drag the element horizontally

y

int

The number of pixels to drag the element vertically

xOffset

int

The horizontal offset within the element's rectangle from which to begin the drag

yOffset

int

The vertical offset within the element's rectangle from which to begin the drag

offsetRef

OffsetReference

The reference used to calculate the offsets within the element

skipValidateDropLocation

bool

Whether to skip validation of the drop location

HoverOver()

Hover over this element.

Declaration

cs-api-definition
public void HoverOver()

HoverOver(Point)

Hover over a specific point relative to the element.

Declaration

cs-api-definition
public void HoverOver(Point p)

Parameters

p

Point

The point to hover over relative to the top left corner of this element. .

HoverOver(int, int, OffsetReference)

Hover over a specific point in this element.

Declaration

cs-api-definition
public void HoverOver(int x, int y, OffsetReference reference)

Parameters

x

int

The x-coordinate of the offset

y

int

The y-coordinate of the offset

reference

OffsetReference

The reference point for the offset

HoverOver(int, int, OffsetReference, ActionPointUnitType)

Hover over a specific point in this element.

Declaration

cs-api-definition
public void HoverOver(int x, int y, OffsetReference reference, ActionPointUnitType unitType)

Parameters

x

int

The x-coordinate of the offset

y

int

The y-coordinate of the offset

reference

OffsetReference

The reference point for the offset

unitType

ActionPointUnitType

The unit type for the x and y coordinates

KeyDown(Keys)

Press key down.

Declaration

cs-api-definition
public void KeyDown(Keys key)

Parameters

key

Keys

KeyPress(Keys, int)

Press a key and hold it down for a specific period of time.

Declaration

cs-api-definition
public void KeyPress(Keys key, int holdFor)

Parameters

key

Keys

The key code for the key to press.

holdFor

int

How long to hold the key down, in milliseconds.

KeyUp(Keys)

Press key up.

Declaration

cs-api-definition
public void KeyUp(Keys key)

Parameters

key

Keys

MouseEnter(OffsetReference)

Enter this element from a certain direction.

Declaration

cs-api-definition
public void MouseEnter(OffsetReference enterSide)

Parameters

enterSide

OffsetReference

The side to enter from

MouseLeave(OffsetReference)

Leave this element from a certain direction.

Declaration

cs-api-definition
public void MouseLeave(OffsetReference leaveSide)

Parameters

leaveSide

OffsetReference

The direction to leave from

MouseMove(List<Point>, int, bool)

Move the mouse along the defined path.

Declaration

cs-api-definition
public void MouseMove(List<Point> path, int delayBetweenPathPoints, bool firstPointIsElementCenter)

Parameters

path

List<Point>

The path as a series of points.

delayBetweenPathPoints

int

Delay between mouse moves within the path points in msec.

firstPointIsElementCenter

bool

If set to true, will assume that the first point of the path is this element's center point. Else will simply use the passed in path.

TurnMouseWheel(int, MouseWheelTurnDirection, bool)

Turn the mouse wheel over over this element.

Declaration

cs-api-definition
public void TurnMouseWheel(int delta, MouseWheelTurnDirection direction, bool clickFirst)

Parameters

delta

int

The delta to turn the wheel.

direction

MouseWheelTurnDirection

The turn direction.

clickFirst

bool

Whether you want the element clicked first.

TypeText(string, int)

Type text as a real user. By default click the element to place the cursor in it.

Declaration

cs-api-definition
public void TypeText(string text, int keyPressTime)

Parameters

text

string

The text to type.

keyPressTime

int

The delay between each press

TypeText(string, int, bool)

Type text as a real user.

Declaration

cs-api-definition
public void TypeText(string text, int keyPressTime, bool clickFirst)

Parameters

text

string

The text to type.

keyPressTime

int

The delay between each press

clickFirst

bool

Whether to click the element first before typing. Used to place cursor in TextBoxes for example.

TypeText(string, int, int, bool, bool)

Type text as a real user.

Declaration

cs-api-definition
public void TypeText(string text, int keyPressTime, int holdTime, bool clickFirst, bool supportUnicode = true)

Parameters

text

string

The text to type.

keyPressTime

int

The delay between each press

holdTime

int

The delay between pressing and releasing each key

clickFirst

bool

Whether to click the element first before typing. Used to place cursor in TextBoxes for example.

supportUnicode

bool

Support unicode or not.