Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99409

How do i tell Selenium to wait until report get ready to download

$
0
0

After the selection of date from the date picker,clicking on 'View Report' button and then its take a time to generate the report and then it download the report.. My following code is working without an error but how do i use fluent wait instead of Thread.sleep(20000),(last line in below code). For fluent or explicit wait i ask to wait for what condition? Also wanted to verify whether the file has been downloaded or not with assertion. Any help will be appreciated.

public void generateReport() throws Exception {
        clickDatePicker.click();
        log.info("Select the Date from datepicker");
        Select month = new Select(selectMonth);
        month.selectByValue("0");
        log.info("Selected the Month from datepicker");
        Select year = new Select(selectYear);
        year.selectByValue("2020");
        log.info("Selected the Year from datepicker");
        act.moveToElement(selectDate).click().build().perform();
        buttonViewReport.click();
        log.info("Finally clicked on Get Report button ");
        Thread.sleep(20000);        
        }

Viewing all articles
Browse latest Browse all 99409

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>