Click or drag to resize

FilesHelperWaitForFile(Double, Int32, String, Boolean) Method

Framework to automate tests using Selenium WebDriver
Waits for file for given timeout till number of files increase in sub folder, checks the size of the current file.

Namespace: Ocaramba.Helpers
Assembly: OcarambaLite (in OcarambaLite.dll) Version: 1.0.0+d8e789f8644d1a9b63485ad7914acf4f489f3ef9
Syntax
C#
public static void WaitForFile(
	double waitTime,
	int filesNumber,
	string folder,
	bool checkSize
)
Request Example

Parameters

waitTime  Double
Wait timeout.
filesNumber  Int32
The initial files number.
folder  String
The folder.
checkSize  Boolean
Check if the size, in bytes, of the current file > 0.
Example
How to use it:
C#
var filesNumber = FilesHelper.CountFiles(this.DriverContext.DownloadFolder);
this.Driver.GetElement(this.fileLink.Format("some-file.txt")).Click();
FilesHelper.WaitForFile(BaseConfiguration.LongTimeout, filesNumber, this.DriverContext.DownloadFolder, true);
See Also