Class
Desktop

Class representing the desktop input devices. Mouse and Keyboard.

Definition

Namespace:ArtOfTest.WebAii.Core

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class Desktop : IDisposable

Inheritance: objectDesktop

Implements: IDisposable

Constructors

Desktop()

Create a new desktop object

Declaration

cs-api-definition
public Desktop()

Properties

Annotator

Annotator that draws on the desktop

Declaration

cs-api-definition
public Annotator Annotator { get; }

Property Value

Annotator

KeyBoard

Gets the keyboard object that enables simulating real keyboard events.

Declaration

cs-api-definition
public KeyBoard KeyBoard { get; }

Property Value

KeyBoard

Mouse

Gets the mouse object that enables simulating real mouse events.

Declaration

cs-api-definition
public Mouse Mouse { get; }

Property Value

Mouse

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

cs-api-definition
public bool ValidateMouseActionsWithinBrowserContent { get; set; }

Property Value

bool

Methods

DisableAutoDomRefresh()

Disables auto dom refresh for Mouse/Keyboard actions

Declaration

cs-api-definition
public void DisableAutoDomRefresh()

Dispose()

Releases all resources used by the Desktop

Declaration

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

EnableAutoDomRefresh(IAutomationHost)

Enables the Desktop Mouse/Keyboard objects to perform auto dom refreshes after Click/DragDrop/SendKey actions.

Declaration

cs-api-definition
public void EnableAutoDomRefresh(IAutomationHost targetBrowser)

Parameters

targetBrowser

IAutomationHost

The target browser to perform refresh on.

ImageMatch(Image, double, int)

Finds an image on the desktop

Declaration

cs-api-definition
public Rectangle ImageMatch(Image image, double score, int index = 0)

Parameters

image

Image

An image to look for

score

double

Minimum percentage of similarity between the image and elements on the Desktop (from 0 to 100) to consider them matching.

index

int

Index (0-based) of the match to be returned

Returns

Rectangle

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

cs-api-definition
public ReadOnlyCollection<Rectangle> ImageMatches(Image image, double score)

Parameters

image

Image

An image to look for

score

double

Minimum percentage of similarity between the image and elements on the Desktop (from 0 to 100) to consider them matching.

Returns

ReadOnlyCollection<Rectangle>

A Rectangle collection with coordinates of the all areas where the image was found on the Desktop