UITestControl.WaitForCondition<T> Method (T, Predicate<T>, Int32)

Blocks the current thread until the specified condition is met, or until the specified time-out expires.

Namespace:  Microsoft.VisualStudio.TestTools.UITesting
Assembly:  Microsoft.VisualStudio.TestTools.UITesting (in Microsoft.VisualStudio.TestTools.UITesting.dll)

Syntax

'Declaration
Public Shared Function WaitForCondition(Of T) ( _
    conditionContext As T, _
    conditionEvaluator As Predicate(Of T), _
    millisecondsTimeout As Integer _
) As Boolean
public static bool WaitForCondition<T>(
    T conditionContext,
    Predicate<T> conditionEvaluator,
    int millisecondsTimeout
)
public:
generic<typename T>
static bool WaitForCondition(
    T conditionContext, 
    Predicate<T>^ conditionEvaluator, 
    int millisecondsTimeout
)
static member WaitForCondition : 
        conditionContext:'T * 
        conditionEvaluator:Predicate<'T> * 
        millisecondsTimeout:int -> bool
JScript does not support generic types or methods.

Type Parameters

  • T
    The Type that specifies the Type for the condition and predicate.

Parameters

  • conditionContext
    Type: T

    The context to evaluate the condition.

  • conditionEvaluator
    Type: Predicate<T>

    The delegate to evaluate the condition.

  • millisecondsTimeout
    Type: Int32

    The number of milliseconds before time-out.

Return Value

Type: Boolean
true if the condition is met before the time-out; otherwise, false.

Remarks

When the wait operation causes an implicit search for the control or, when the application is busy, the actual wait time could be more than the time-out specified.

.NET Framework Security

See Also

Reference

UITestControl Class

WaitForCondition Overload

Microsoft.VisualStudio.TestTools.UITesting Namespace