 | FilesHelperWaitForFileOfGivenType(FileType, Double, Int32, String, Boolean) Method |
Framework to automate tests using Selenium WebDriver
Waits for file of given type for given timeout till number of files increase in sub folder,checks the size of the current file.
Namespace: Ocaramba.HelpersAssembly: OcarambaLite (in OcarambaLite.dll) Version: 4.2.8+a9b8573c8e7a79d20d13aab3058972497cab0398
Syntaxpublic static void WaitForFileOfGivenType(
FileType type,
double waitTime,
int filesNumber,
string folder,
bool checkSize
)
Request Example
Parameters
- type FileType
- The type of file.
- 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.
ExampleHow to use it:
var filesNumber = FilesHelper.CountFiles(this.DriverContext.DownloadFolder, FileType.Txt);
this.Driver.GetElement(this.fileLink.Format("some-file.txt")).Click();
FilesHelper.WaitForFileOfGivenType(FileType.Txt, BaseConfiguration.LongTimeout, filesNumber, this.DriverContext.DownloadFolder);
See Also