Table of Contents

Class TestObjectExtensions

Namespace
HP.LFT.SDK
Assembly
HP.LFT.SDK.dll

Class for extension methods of the TestObject class

public static class TestObjectExtensions
Inheritance
TestObjectExtensions
Inherited Members

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.

public static bool WaitUntilEnabled<T>(this T enabledProvider) where T : IEnabledProvider

Parameters

enabledProvider T

the test object to wait until it becomes enabled.

Returns

bool

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

Type Parameters

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.

public static bool WaitUntilEnabled<T>(this T enabledProvider, int timeout) where T : IEnabledProvider

Parameters

enabledProvider T

the test object to wait until it becomes enabled.

timeout int

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

Returns

bool

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

Type Parameters

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.

public static bool WaitUntilExists<T>(this T testObject) where T : ITestObject

Parameters

testObject T

the test object to wait until it exists.

Returns

bool

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

Type Parameters

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.

public static bool WaitUntilExists<T>(this T testObject, int timeout) where T : ITestObject

Parameters

testObject T

the test object to wait until it exists.

timeout int

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

Returns

bool

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

Type Parameters

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.

public static bool WaitUntilVisible<T>(this T visibleProvider) where T : IVisibleProvider

Parameters

visibleProvider T

the test object to wait until it becomes visible.

Returns

bool

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

Type Parameters

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.

public static bool WaitUntilVisible<T>(this T visibleProvider, int timeout) where T : IVisibleProvider

Parameters

visibleProvider T

the test object to wait until it becomes visible.

timeout int

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

Returns

bool

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

Type Parameters

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.

public static bool WaitUntil<T>(this T testObject, Func<T, bool> funcToRun) where T : ITestObject

Parameters

testObject T

The test object that is passed to the funcToRun function.

funcToRun Func<T, bool>

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

Returns

bool

Boolean value returned from the funcToRun function.

Type Parameters

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.

public static bool WaitUntil<T>(this T testObject, Func<T, bool> funcToRun, int totalTimeOutTime) where T : ITestObject

Parameters

testObject T

The test object that is passed to the funcToRun function.

funcToRun Func<T, bool>

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

totalTimeOutTime int

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

Returns

bool

Boolean value returned from the funcToRun function.

Type Parameters

T

A class implementing ITestObject

Remarks

This overload uses timeout specified in the totalTimeOutTime argument.