Click or drag to resize
Ranorex

ValidateContainsImage Method (Element, Bitmap, ImagingFindOptions, String, Boolean)

Validates if the screenshot of the specified element contains the given image.

Namespace:  Ranorex
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
public static bool ContainsImage(
	Element element,
	Bitmap image,
	ImagingFindOptions findOptions,
	string message,
	bool exceptionOnFail
)

Parameters

element
Type: Ranorex.CoreElement
The element to take the screenshot from.
image
Type: System.DrawingBitmap
The image to search inside the element screenshot.
findOptions
Type: RanorexImagingFindOptions
A ImagingFindOptions instance that defines the options for the search.
message
Type: SystemString
The message to log. "{0}" is replaced by the string representation of the element.
exceptionOnFail
Type: SystemBoolean
A value specifying if an exception should be thrown if the validation fails.

Return Value

Type: Boolean
True if the specified image is contained in the screenshot of the element; otherwise false.
Exceptions
ExceptionCondition
ArgumentNullExceptionIf image is null.
ValidationExceptionIf the validation fails and exceptionOnFail is true.
See Also