Wait for Download to finish in selenium webdriver JAVA

后端 未结 13 1687
醉话见心
醉话见心 2020-12-01 14:38

Once clicking a download button, files will be downloaded. Before executing next code, it needs to wait until the download completes.

My code looks like this:

<
13条回答
  •  Happy的楠姐
    2020-12-01 15:11

    Here's one using just WebDriverWait:

    new WebDriverWait(driver, 60).until(d -> Paths.get(downloadDir, downloadFileName).toFile().exists());
    

提交回复
热议问题