I'm trying to wait for a file to get downloaded using fluent wait. But since the file downloads with different date format. I want to validate with "Partial filename" of the file using fluentWait. For Eg: cancelled_07092019, cancelled_09_07_2019. So here the filename 'canceled_' remains constant
Below code works fine for the actual filename.
Downloaded_report= new File("DownloadPath");
FluentWait<WebDriver> wait = new FluentWait<WebDriver>(driver);
wait.pollingEvery(1, TimeUnit.SECONDS);
wait.withTimeout(15, TimeUnit.SECONDS);
wait.until(x -> downloaded_report.exists());
Here, I want to check the startof the file name. How do I do this? Thanks in Advance