Table of Contents

Class TestObjectExtensions

Class for extension methods of the TestObject class

Inheritance
TestObjectExtensions
Namespace: HP.LFT.SDK
Assembly: HP.LFT.SDK.dll
Syntax
public static class TestObjectExtensions

Methods

WaitUntilEnabled<T>(T)

Waits until the test object becomes enabled or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntilEnabled<T>(this T enabledProvider) where T : IEnabledProvider
Parameters
Type Name Description
T enabledProvider

the test object to wait until it becomes enabled.

Returns
Type Description
bool

true if the test object is enabled before the timeout is reached; otherwise, false.

Type Parameters
Name Description
T

The type of the test object.

Remarks

This overload uses a timeout of 20 seconds.

WaitUntilEnabled<T>(T, int)

Waits until the test object becomes enabled or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntilEnabled<T>(this T enabledProvider, int timeout) where T : IEnabledProvider
Parameters
Type Name Description
T enabledProvider

the test object to wait until it becomes enabled.

int timeout

Timeout (in milliseconds) to wait until the test object becomes enabled.

Returns
Type Description
bool

true if the test object is enabled before the timeout is reached; otherwise, false.

Type Parameters
Name Description
T

The type of the test object.

WaitUntilExists<T>(T)

Waits until the test object exists or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntilExists<T>(this T testObject) where T : ITestObject
Parameters
Type Name Description
T testObject

the test object to wait until it exists.

Returns
Type Description
bool

true if the test object exists before the timeout is reached; otherwise, false.

Type Parameters
Name Description
T

The type of the test object.

Remarks

This overload uses the default object synchronization timeout.

WaitUntilExists<T>(T, int)

Waits until the test object exists or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntilExists<T>(this T testObject, int timeout) where T : ITestObject
Parameters
Type Name Description
T testObject

the test object to wait until it exists.

int timeout

Timeout (in seconds) to wait until the test object exists.

Returns
Type Description
bool

true if the test object exists before the timeout is reached; otherwise, false.

Type Parameters
Name Description
T

The type of the test object.

WaitUntilVisible<T>(T)

Waits until the test object becomes visible or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntilVisible<T>(this T visibleProvider) where T : IVisibleProvider
Parameters
Type Name Description
T visibleProvider

the test object to wait until it becomes visible.

Returns
Type Description
bool

true if the test object is visible before the timeout is reached; otherwise, false.

Type Parameters
Name Description
T

The type of the test object.

Remarks

This overload uses a timeout of 20 seconds.

WaitUntilVisible<T>(T, int)

Waits until the test object becomes visible or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntilVisible<T>(this T visibleProvider, int timeout) where T : IVisibleProvider
Parameters
Type Name Description
T visibleProvider

the test object to wait until it becomes visible.

int timeout

Timeout (in milliseconds) to wait until the test object becomes visible.

Returns
Type Description
bool

true if the test object is visible before the timeout is reached; otherwise, false.

Type Parameters
Name Description
T

The type of the test object.

WaitUntil<T>(T, Func<T, bool>)

Waits until a certain condition is met in the specified boolean function or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntil<T>(this T testObject, Func<T, bool> funcToRun) where T : ITestObject
Parameters
Type Name Description
T testObject

The test object that is passed to the funcToRun function.

Func<T, bool> funcToRun

A function returning a boolean result. The function runs until the function result is true, or until the object synchronization timeout elapses.

Returns
Type Description
bool

Boolean value returned from the funcToRun function.

Type Parameters
Name Description
T

A class implementing ITestObject

Remarks

This overload uses the default object synchronization timeout.

WaitUntil<T>(T, Func<T, bool>, int)

Waits until a certain condition is met in the specified boolean function or the timeout elapses. This method is useful for synchronizing your test with your application.

Declaration
public static bool WaitUntil<T>(this T testObject, Func<T, bool> funcToRun, int totalTimeOutTime) where T : ITestObject
Parameters
Type Name Description
T testObject

The test object that is passed to the funcToRun function.

Func<T, bool> funcToRun

A function returning a boolean result. The function runs until the function result is true, or until the specified timeout elapses.

int totalTimeOutTime

Timeout (in milliseconds) to wait until funcToRun function becomes true.

Returns
Type Description
bool

Boolean value returned from the funcToRun function.

Type Parameters
Name Description
T

A class implementing ITestObject

Remarks

This overload uses timeout specified in the totalTimeOutTime argument.