Share via


IApp.WaitFor Method

Definition

Generic wait function that will repeatly call the predicate function until it returns true. Throws a TimeoutException if the predicate is not fullfilled within the time limit.

public void WaitFor (Func<bool> predicate, string timeoutMessage = "Timed out waiting...", Nullable<TimeSpan> timeout = null, Nullable<TimeSpan> retryFrequency = null, Nullable<TimeSpan> postTimeout = null);
abstract member WaitFor : Func<bool> * string * Nullable<TimeSpan> * Nullable<TimeSpan> * Nullable<TimeSpan> -> unit
Public Sub WaitFor (predicate As Func(Of Boolean), Optional timeoutMessage As String = "Timed out waiting...", Optional timeout As Nullable(Of TimeSpan) = null, Optional retryFrequency As Nullable(Of TimeSpan) = null, Optional postTimeout As Nullable(Of TimeSpan) = null)

Parameters

predicate
Func<Boolean>

Predicate function that should return true when waiting is complete.

timeoutMessage
String

The message used in the TimeoutException.

timeout
Nullable<TimeSpan>

The TimeSpan to wait before failing.

retryFrequency
Nullable<TimeSpan>

The TimeSpan to wait between each call to the predicate.

postTimeout
Nullable<TimeSpan>

The final TimeSpan to wait after the predicate returns true.

Applies to