ITestee Methods
Adds a global image processing filter. All filters will be applied to the current screen of the subject under test before further processing (image recognition, ocr) takes place.
Syntax:
void AddFilter(
IImageFilter filter
)
Parameter | Description |
filter |
Removes all globally registered image processing filters.
Syntax:
void ClearFilter()
Executes an image search (single result) on the subject under test.
The engine will try to find the image that is specified by imageName or all images contained in the folder (incl subfolders) specified by imageName.
imageName refers to the relative location within the Images directory of the project, folders are separated by dots. E.g.
"Screens.MyScreen.MyImage"
.
However the designer automatically generates classes so you can use intelliSense to specify the image, the same image would be provided with TestImages.MyProject.Images.Screens.MyImage
or just Images.Screens.MyImage
if the correct using is set.Syntax:
IEngineResult FindImage(
string imageName,
TimeSpan searchDuration = default,
ImageDetectionParameters parameters = null,
params IImageFilter[] filters
)
Parameter | Description |
imageName | |
[searchDuration] | |
[parameters] | |
[filters] | Specifies a collection of possible filters that are used to pre-process the current screen image before the image will be searched for |
Executes an image search (multiple results) on the subject under test.
Syntax:
IList<IEngineResult> FindImages(
string imageName,
TimeSpan searchDuration = default,
ImageDetectionParameters parameters = null,
params IImageFilter[] filters
)
Parameter | Description |
imageName | |
[searchDuration] | |
[parameters] | |
[filters] | Specifies a collection of possible filters that are used to pre-process the current screen image before the image will be searched for |
Executes a text search (single result) on the subject under test
Syntax:
IEngineResult FindText(
string content,
TimeSpan searchDuration = default,
OcrEngineParameters parameters = null,
params IImageFilter[] filters
)
Parameter | Description |
content | |
[searchDuration] | |
[parameters] | |
[filters] | Specifies a collection of possible filters that are used to pre-process the current screen image before the text is search for |
Return Value:
Returns an IEngineResult with the position, detected text and corresponding accuracy where the specified text was found as a best match, i.e. highest accuracy
Executes a text search (multiple results) on the subject under test
Syntax:
IList<IEngineResult> FindTexts(
string content,
TimeSpan searchDuration = default,
OcrEngineParameters parameters = null,
params IImageFilter[] filters
)
Parameter | Description |
content | |
[searchDuration] | |
[parameters] | |
[filters] | Specifies a collection of possible filters that are used to pre-process the current screen image before the text is search for |
Return Value:
Returns a list of IEngineResults with all positions, detected text and corresponding accuracy where the specified text was found.
Returns the screen of the currently active SUT.
Syntax:
Bitmap GetCurrentScreen(
params IImageFilter[] filters
)
Parameter | Description |
[filters] | Specifies a collection of possible filters that are used to pre-process the current screen before the image is taken |
Overload List
Name | Description |
GetRemoteClipboard
(int?) | Returns the clipboard content of the subject under tests. |
GetRemoteClipboard (bool, int?) | Returns the clipboard content of the subject under tests. |
Returns the clipboard content of the subject under tests. The method waits until the subject under test signals that there is new content in its clipboard. If the subject under test signals the availablity of new content before this method is called the call will return instantly with the information of the remote clipboard. If no new content is received during waitTimeout, the last content that was received is returned.
Note that for most VNC servers no new content is signaled, when the same content is copied again, or an empty text selection is copied.
Syntax:
string GetRemoteClipboard(
int? waitTimeout = null
)
Parameter | Description |
[waitTimeout] | Maximum time in milliseconds the function waits to receive content from the remote clipboard. Defaults to t.Properties.ClipboardTimeOut if null or not set. |
Return Value:
The content of the SUT clipboard.
Returns the clipboard content of the subject under tests. The method waits until the subject under test signals that there is new content in its clipboard. If the subject under test signals the availablity of new content before this method is called the call will return instantly with the information of the remote clipboard. If no new content is received during waitTimeout, the last content that was received is returned, but wasTimeoutTriggered is set to true.
Note that for most VNC servers no new content is signaled, when the same content is copied again, or an empty text selection is copied.
Syntax:
string GetRemoteClipboard(
out bool wasTimeoutTriggered,
int? waitTimeout = null
)
Parameter | Description |
wasTimeoutTriggered | Set to true if the provided timeout passed. To make sure that you got the most accurate content, you can check this property |
[waitTimeout] | Maximum time in milliseconds the function waits to receive content from the remote clipboard. Defaults to t.Properties.ClipboardTimeOut if null or not set. |
Return Value:
The content of the SUT clipboard.
Reads the text on the screen of the subject under test
Syntax:
string GetText(
OcrEngineParameters parameters,
params IImageFilter[] filters
)
Parameter | Description |
[parameters] | |
[filters] | Specifies a collection of possible filters that are used to pre-process the current screen image before the text is to be found |
Return Value:
Returns all text found on the current screen
Forces the internal data structure to be updated with a new screenshot from the subject under test
Syntax:
void RefreshScreen()
Registers a callback for graphical updates from the SUT. Must be unregistered afterwards by calling UnregisterFromUpdateCheck with the corresponding GUID.
Use t.WaitUntilStableScreen or t.WaitUntilScreenUpdate for easier use of this functionality.
Syntax:
Guid RegisterForUpdateCheck(
Action<double> updateHandler,
double allowedEuclideanDistance,
params IImageFilter[] filters
)
Parameter | Description |
updateHandler | |
allowedEuclideanDistance | Defines how much of the reference image can be changed |
filters | Specifies a collection of possible filters that are used to pre-process the current screen image before the screenshot is taken |
Saves an image with the specified name and additional information which might be setup via the global properties
Syntax:
IEngineResult SaveImage(
Bitmap image,
string name,
out string persistedName
)
Sets the clipboard content of the subject under test
Syntax:
void SetRemoteClipboard(
string content
)
Parameter | Description |
content | Information to put into the remote clipboard |
Takes a screenshot and saves it with the specified name and additional information which might be setup via the global properties.
Syntax:
IEngineResult TakeScreenshot(
string name,
params IImageFilter[] filters
)
Parameter | Description |
name | Specifies the base name of the screenshot |
[filters] | Specifies a collection of possible filters that are used to pre-process the current screen image before the screenshot is taken |
Unregisters a callback for graphical updates from the SUT.
Syntax:
void UnregisterFromUpdateCheck(
Guid updateCheckId
)
Parameter | Description |
updateCheckId | Identifier received while registering the update check |
Last modified 3yr ago