Click or drag to resize

WaitHelper.Wait(Func<Boolean>, TimeSpan, TimeSpan, String) Method

Framework to automate tests using Selenium WebDriver
Wait for a condition with given timeout and timeInterval.

Namespace: Ocaramba.Helpers
Assembly: OcarambaLite (in OcarambaLite.dll) Version: 4.2.4
Syntax
C#
public static void Wait(
	Func<bool> condition,
	TimeSpan timeout,
	TimeSpan sleepInterval,
	string message
)
Request Example

Parameters

condition  Func<Boolean>
The condition to be met.
timeout  TimeSpan
The timeout value [seconds] indicating how long to wait for the condition.
sleepInterval  TimeSpan
The value [seconds] indicating how often to check for the condition to be true.
message  String
The exception message.
Exceptions
ExceptionCondition
WaitTimeoutExceptionTimeout exception when condition is not met.
Example
How to use it:
C#
WaitHelper.Wait(() => CountFiles(folder, type) > filesNumber, TimeSpan.FromSeconds(waitTime), TimeSpan.FromSeconds(1), timeoutMessage);
See Also