Click or drag to resize

WaitHelperWait(FuncBoolean, TimeSpan, TimeSpan) 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: 1.0.0+d8e789f8644d1a9b63485ad7914acf4f489f3ef9
Syntax
C#
public static bool Wait(
	Func<bool> condition,
	TimeSpan timeout,
	TimeSpan sleepInterval
)
Request Example

Parameters

condition  FuncBoolean
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.

Return Value

Boolean
True if condition is met in given timeout.
Example
How to use it:
C#
bool result = WaitHelper.Wait(() => CountFiles(folder, type) > filesNumber, TimeSpan.FromSeconds(waitTime), TimeSpan.FromSeconds(1));
See Also