How to verify a downloaded file by using only parts of the name

If you have a test case that downloads a file where the name changes (may include dynamic dates or numbers that you can't predict), you can use parts of the name to verify this file.

Let's suppose that the file name is "Automation 2023-03-16 - Subject7.pdf" and the date here is dynamic. We can search using "Automation", "Subject7" and ".pdf" excluding everything else. 

1. In Verify_File_Download command, we select the option WILDCARD

2. In the Base Directory field, we enter the path where the file will always get downloaded to. For example: C:\Users\admin\Downloads

3. In the Local Path, we enter the parts that we will use to find the file in the same order they appear separated by a wildcard as below:

Automation*Subject7*.pdf

4. Note that the Base Directory in step can also use wildcards. For example, your files get downloaded under different folders in Downloads directory and you don't know which folder will be used, you can use:

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.