Hi everybody!
I want to check the existence of some special files in a directory in the Windows explorer.
Is this possible?
Example:
Open Application: C:\Program Files\test\file1.jar and so on.
Validation: file1.jar exists
Maybe it's possible to create a list of files which will be checked?
Thanks for your help.
Validation question: checking files in directory
Re: Validation question: checking files in directory
Hi,
In my opinion, the best way to achieve what you want is to use C# code, e.g. File.Exists() method.
https://www.geeksforgeeks.org/file-exis ... -examples/
Eventually, use Directory.GetFiles() method to obtain the list of files and check the existence of certain file via foreach loop...
https://stackoverflow.com/a/58978165
Using Explorer and UI is a waste of time and energy for this particular task
In my opinion, the best way to achieve what you want is to use C# code, e.g. File.Exists() method.
https://www.geeksforgeeks.org/file-exis ... -examples/
Eventually, use Directory.GetFiles() method to obtain the list of files and check the existence of certain file via foreach loop...
https://stackoverflow.com/a/58978165
Using Explorer and UI is a waste of time and energy for this particular task
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Validation question: checking files in directory
Code: Select all
using System.IO;
string path = "C:/myfolder/";
if (File.Exists(path))
{
Ranorex.Report.Info(path, "file exists");
}