ClassDesktop
Class representing the desktop input devices. Mouse and Keyboard.
Definition
Namespace:ArtOfTest.WebAii.Core
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class Desktop : IDisposable
Inheritance: objectDesktop
Implements:
Constructors
Properties
Annotator
Annotator that draws on the desktop
KeyBoard
Gets the keyboard object that enables simulating real keyboard events.
Mouse
Gets the mouse object that enables simulating real mouse events.
ValidateMouseActionsWithinBrowserContent
Gets/Sets whether to validate all mouse actions to ensure they are within the browser's content window. If this is set to true, any mouse action outside that region will throw an exception.
Declaration
public bool ValidateMouseActionsWithinBrowserContent { get; set; }
Property Value
Methods
DisableAutoDomRefresh()
Disables auto dom refresh for Mouse/Keyboard actions
Declaration
public void DisableAutoDomRefresh()
Dispose()
Releases all resources used by the Desktop
Declaration
public void Dispose()
Implements
EnableAutoDomRefresh(IAutomationHost)
Enables the Desktop Mouse/Keyboard objects to perform auto dom refreshes after Click/DragDrop/SendKey actions.
Declaration
public void EnableAutoDomRefresh(IAutomationHost targetBrowser)
Parameters
targetBrowser
The target browser to perform refresh on.
ImageMatch(Image, double, int)
Finds an image on the desktop
Declaration
public Rectangle ImageMatch(Image image, double score, int index = 0)
Parameters
image
An image to look for
score
Minimum percentage of similarity between the image and elements on the Desktop (from 0 to 100) to consider them matching.
index
Index (0-based) of the match to be returned
Returns
A Rectangle with coordinates of the area where the image was found on the Desktop
ImageMatches(Image, double)
Finds an image on the desktop
Declaration
public ReadOnlyCollection<Rectangle> ImageMatches(Image image, double score)
Parameters
image
An image to look for
score
Minimum percentage of similarity between the image and elements on the Desktop (from 0 to 100) to consider them matching.
Returns
A Rectangle collection with coordinates of the all areas where the image was found on the Desktop