Interface ITestObject
Base interface for all test objects.
public interface ITestObject : ITestObjectDescriber
- Inherited Members
- Extension Methods
Properties
DisplayName
The object display name defined in the Application Model.
string DisplayName { get; set; }
Property Value
Parent
The parent test object of this test object. The child object must be obtained using the Describe method, otherwise, it returns null.
ITestObject Parent { get; }
Property Value
Remarks
For example, if the test object is a WebElement, the Parent is the IFrame or IBrowser test object that contains it.
Methods
CallFTMethod(string, params object[])
Calls a method or property of an OpenText Functional Testing test object.
void CallFTMethod(string methodName, params object[] arguments)
Parameters
methodNamestringThe name of the method or property to call.
argumentsobject[]Additional arguments that are required for the method or property.
CallFTMethod<TResult>(string, params object[])
Calls a method or property of an OpenText Functional Testing test object.
TResult CallFTMethod<TResult>(string methodName, params object[] arguments)
Parameters
methodNamestringThe name of the method or property to call.
argumentsobject[]Additional arguments that are required for the method or property.
Returns
- TResult
An object of the return type specified.
Type Parameters
TResultThe return type.
Exists()
Checks whether this object exists in the AUT before the default object synchronization timeout elapses.
bool Exists()
Returns
Exists(uint)
Checks whether this object exists in the AUT before the specified timeout elapses.
bool Exists(uint timeout)
Parameters
timeoutuintThe time (in seconds) to wait for this object before returning the true or false result.
Returns
FindChildren<TChild>(IDescription)
Returns all the child test objects that match the specified test object type and description filter.
For example, you can use this method to retrieve all Web buttons on a Page with type="submit".
TChild[] FindChildren<TChild>(IDescription selector) where TChild : class, ITestObject
Parameters
selectorIDescriptionA description containing the set of properties and values that should be common to all objects that are returned.
Returns
- TChild[]
An array of child test objects.
Type Parameters
TChildThe test object interface type to find. To avoid limiting to a specific test object type, use ITestObject.
GetDescription()
Returns a clone of the description for this test object. The test object must be obtained using the Describe method, otherwise, this method returns null.
IDescription GetDescription()
Returns
GetSnapshot()
Captures a bitmap of this test object and returns a Image of it.
Image GetSnapshot()
Returns
GetTextLocations(string)
Returns all rectangle areas containing the specified text within this object (Windows only).
Rectangle[] GetTextLocations(string textToFind)
Parameters
textToFindstringThe text string to find.
Returns
GetTextLocations(string, Rectangle)
Returns all rectangle areas within the supplied rectangle that contain the specified text (Windows only).
Rectangle[] GetTextLocations(string textToFind, Rectangle textArea)
Parameters
textToFindstringThe text string to find.
textAreaRectangleAn inner rectangle within this object.
Returns
GetVisibleText()
Returns all visible text from this object.
string GetVisibleText()
Returns
GetVisibleText(Rectangle)
Returns all visible text within the supplied rectangle.
string GetVisibleText(Rectangle textArea)
Parameters
textAreaRectangleAn inner rectangle within this object.
Returns
Highlight()
Highlights this object in the AUT.
void Highlight()
Remarks
This may be useful when debugging a test.
HighlightMatches<TChild>(IDescription)
Highlights all children that match the specified test object type and description filter.
uint HighlightMatches<TChild>(IDescription description) where TChild : class, ITestObject
Parameters
descriptionIDescriptionA description containing the set of properties and values that is common to all objects to be are highlighted.
Returns
- uint
The number of object that match the provided description and were highlighted.
Type Parameters
TChildThe test object interface type to highlight. To avoid limiting to a specific test object type, use ITestObject.
SetDescription(IDescription)
Replaces this test object's description with the supplied description.
void SetDescription(IDescription description)
Parameters
descriptionIDescriptionThe new IDescription for this test object. (A clone of the provided Description is used.)
VerifyImageExists(Image, byte)
Checks whether a snapshot of this object contains the supplied image.
Point? VerifyImageExists(Image imageToFind, byte similarity = 100)
Parameters
imageToFindImageThe image to look for within the test object's snapshot.
similaritybyteOptional. The minimum similarity between the two images (as a percentage), above which the find is considered a match. Default = 100.
Returns
- Point?
the Point where the image was located, or null if it was not found.
Remarks
When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
VerifyImageMatch(Image, ImageMaskArea, byte, byte)
Checks whether the defined mask areas within the object snapshot and the supplied image match, given the specified pixel and RGB tolerance values.
bool VerifyImageMatch(Image expectedImage, ImageMaskArea maskArea, byte pixelTolerance = 0, byte rgbTolerance = 0)
Parameters
expectedImageImageThe image to compare to the test object snapshot.
maskAreaImageMaskAreaThe mask area within the two images to use for the comparison.
pixelTolerancebyteOptional. The percentage of pixels that can differ between the two images, and still be considered a match. Default = 0.
rgbTolerancebyteOptional. The percent by which the RGB values of the pixels in the two images can differ, and still be considered a match. Default = 0.
Returns
Remarks
Returns true only if the mask areas match and the two full images are the same size.
When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
VerifyImageMatch(Image, byte, byte)
Checks whether a snapshot of this object and the supplied image are a match, given the specified pixel and RGB tolerance values.
bool VerifyImageMatch(Image expectedImage, byte pixelTolerance = 0, byte rgbTolerance = 0)
Parameters
expectedImageImageThe image to compare to the test object snapshot.
pixelTolerancebyteOptional. The percentage of pixels that can differ between the two images, and still be considered a match. Default = 0.
rgbTolerancebyteOptional. The percent by which the RGB values of the pixels in the two images can differ, and still be considered a match. Default = 0.
Returns
Remarks
When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.