Im creating an automation testing using Selenium+Lambda and have to validade if a file is downloaded.
I found the following solution in lambda support page https://www.lambdatest.com/support/docs/download-files-using-lambdatest-selenium-grid/
Indeed i implemented the following and worked, my test its validating if a file is downloaded or not. "Assert.assertEquals(((JavascriptExecutor) driver).executeScript("lambda-file-exists=myw3schoolsimage.jpg"), true);"
The problem is.. i had to pass the file name hardcoded in that command, and that wont work for my scenarios as my files have dinamic names.
There is a way handle it?
Thanks!
Check whether the downloaded file exists in the test machine.
List down the file in the download directory.
ie:
Response: List of files in downloads dir starting with sample