ClassUserInteraction
Definition
Namespace:ArtOfTest.WebAii.Silverlight
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class UserInteraction
Inheritance: objectUserInteraction
Methods
Click()
Click this control by moving the mouse to it and click it.
Declaration
public void Click()
Click(MouseClickType)
Click this control by moving the mouse to it and click it.
Declaration
public void Click(MouseClickType clickType)
Parameters
clickType
The mouse click type to use.
Click(MouseClickType, Point)
Click this control by moving the mouse to it and click it.
Declaration
public void Click(MouseClickType clickType, Point offsetPoint)
Parameters
clickType
The mouse click type to use.
offsetPoint
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
public void Click(MouseClickType clickType, Point offsetPoint, OffsetReference reference)
Parameters
clickType
The mouse click type to use.
offsetPoint
The offset point to use from the reference specified of the control
reference
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
public void Click(MouseClickType clickType, int x, int y, OffsetReference reference)
Parameters
clickType
The mouse click type to use.
x
The X-coordinate of the offset point to use
y
The Y-coordinate of the offset point to use
reference
The desired reference point to use to calculate the offset
Click(MouseClickType, int, int, OffsetReference, ActionPointUnitType)
Declaration
public void Click(MouseClickType clickType, int x, int y, OffsetReference reference, ActionPointUnitType unitType)
Parameters
clickType
x
y
reference
unitType
Click(MouseClickType, int, int, OffsetReference, ActionPointUnitType, Keys)
Click this control by moving the mouse to it and click it.
Declaration
public void Click(MouseClickType clickType, int x, int y, OffsetReference reference, ActionPointUnitType unitType, Keys modifierKeys)
Parameters
clickType
The mouse click type to use.
x
The X-coordinate of the offset point to use
y
The Y-coordinate of the offset point to use
reference
The desired reference point to use to calculate the offset
unitType
The units in which the X and Y coordinates are specified
modifierKeys
Combination of modifier keys to hold while clicking
ClickPoint(MouseClickType, Point)
Click an absolute point on the screen.
Declaration
public void ClickPoint(MouseClickType clickType, Point absolutePoint)
Parameters
clickType
The mouse click type to use.
absolutePoint
The absolute point to click
ClickPoint(Point)
Click an absolute point on the screen.
Declaration
public void ClickPoint(Point absolutePoint)
Parameters
absolutePoint
The point to click.
DetectHotSpot(int)
Get the hot spot within this element that causes the mouse to change shape.
DetectHotSpot(int, Cursor)
Get the hot spot within this element that causes the mouse to change to the specified cursor
DragTo(FrameworkElement)
Drag this element from its center to the center of the dropTarget
Declaration
public void DragTo(FrameworkElement dropTarget)
Parameters
dropTarget
The drop target element
DragTo(int, int)
Drag this element from its center to the x,y offset.
DragTo(int, int, OffsetReference, ActionPointUnitType, FrameworkElement, int, int, OffsetReference, ActionPointUnitType, bool)
Drag this element to the dropTarget
Declaration
public void DragTo(int startOffsetX, int startOffsetY, OffsetReference startOffsetReference, ActionPointUnitType startUnitType, FrameworkElement dropTarget, int endOffsetX, int endOffsetY, OffsetReference endOffsetReference, ActionPointUnitType endUnitType, bool skipValidateDropLocation)
Parameters
startOffsetX
The horizontal offset within this element from which to begin the drag
startOffsetY
The vertical offset within this element from which to begin the drag
startOffsetReference
The reference used to calculate the offsets within this element
startUnitType
dropTarget
The drop target element
endOffsetX
The horizontal offset within the drop target at which to end the drag
endOffsetY
The vertical offset within the drop target at which to end the drag
endOffsetReference
The reference used to calculate the offsets within the drop target element
endUnitType
skipValidateDropLocation
Whether to skip validation of the drop location
DragTo(int, int, OffsetReference, FrameworkElement, int, int, OffsetReference)
Drag this element to the dropTarget
Declaration
public void DragTo(int startOffsetX, int startOffsetY, OffsetReference startOffsetReference, FrameworkElement dropTarget, int endOffsetX, int endOffsetY, OffsetReference endOffsetReference)
Parameters
startOffsetX
The horizontal offset within this element from which to begin the drag
startOffsetY
The vertical offset within this element from which to begin the drag
startOffsetReference
The reference used to calculate the offsets within this element
dropTarget
The drop target element
endOffsetX
The horizontal offset within the drop target at which to end the drag
endOffsetY
The vertical offset within the drop target at which to end the drag
endOffsetReference
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
public void DragTo(int x, int y, bool autoDetectStartHotSpot)
Parameters
x
The x offset from the center.
y
The y offset from the center.
autoDetectStartHotSpot
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
public void DragTo(int x, int y, bool autoDetectStartHotSpot, Cursor hotSpotCursor, int radius)
Parameters
x
The x offset from the center.
y
The y offset from the center.
autoDetectStartHotSpot
Whether to auto-detect the hot spot at the start of the drag or no.
hotSpotCursor
A specific cursor to check for as the hot spot indicator
radius
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
public void DragTo(int x, int y, bool autoDetectStartHotSpot, Cursor hotSpotCursor, int radius, bool skipValidateDropLocation)
Parameters
x
The x offset from the center.
y
The y offset from the center.
autoDetectStartHotSpot
Whether to auto-detect the hot spot at the start of the drag or no.
hotSpotCursor
A specific cursor to check for as the hot spot indicator
radius
The search radios from the center point of the source element.
skipValidateDropLocation
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
public void DragTo(int x, int y, int xOffset, int yOffset, OffsetReference offsetRef)
Parameters
x
The number of pixels to drag the element horizontally
y
The number of pixels to drag the element vertically
xOffset
The horizontal offset within the element's rectangle from which to begin the drag
yOffset
The vertical offset within the element's rectangle from which to begin the drag
offsetRef
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
public void DragTo(int x, int y, int xOffset, int yOffset, OffsetReference offsetRef, bool skipValidateDropLocation)
Parameters
x
The number of pixels to drag the element horizontally
y
The number of pixels to drag the element vertically
xOffset
The horizontal offset within the element's rectangle from which to begin the drag
yOffset
The vertical offset within the element's rectangle from which to begin the drag
offsetRef
The reference used to calculate the offsets within the element
skipValidateDropLocation
Whether to skip validation of the drop location
HoverOver(Point)
Hover over a specific point relative to the element.
Declaration
public void HoverOver(Point p)
Parameters
p
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
public void HoverOver(int x, int y, OffsetReference reference)
Parameters
x
The x-coordinate of the offset
y
The y-coordinate of the offset
reference
The reference point for the offset
HoverOver(int, int, OffsetReference, ActionPointUnitType)
Hover over a specific point in this element.
Declaration
public void HoverOver(int x, int y, OffsetReference reference, ActionPointUnitType unitType)
Parameters
x
The x-coordinate of the offset
y
The y-coordinate of the offset
reference
The reference point for the offset
unitType
The unit type for the x and y coordinates
KeyDown(Keys)
Press key down.
KeyPress(Keys, int)
Press a key and hold it down for a specific period of time.
KeyUp(Keys)
Press key up.
MouseEnter(OffsetReference)
Enter this element from a certain direction.
Declaration
public void MouseEnter(OffsetReference enterSide)
Parameters
enterSide
The side to enter from
MouseLeave(OffsetReference)
Leave this element from a certain direction.
Declaration
public void MouseLeave(OffsetReference leaveSide)
Parameters
leaveSide
The direction to leave from
MouseMove(List<Point>, int, bool)
Move the mouse along the defined path.
Declaration
public void MouseMove(List<Point> path, int delayBetweenPathPoints, bool firstPointIsElementCenter)
Parameters
path
The path as a series of points.
delayBetweenPathPoints
Delay between mouse moves within the path points in msec.
firstPointIsElementCenter
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
public void TurnMouseWheel(int delta, MouseWheelTurnDirection direction, bool clickFirst)
Parameters
delta
The delta to turn the wheel.
direction
The turn direction.
clickFirst
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.
TypeText(string, int, bool)
Type text as a real user.
TypeText(string, int, int, bool, bool)
Type text as a real user.
Declaration
public void TypeText(string text, int keyPressTime, int holdTime, bool clickFirst, bool supportUnicode = true)
Parameters
text
The text to type.
keyPressTime
The delay between each press
holdTime
The delay between pressing and releasing each key
clickFirst
Whether to click the element first before typing. Used to place cursor in TextBoxes for example.
supportUnicode
Support unicode or not.