AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Selenium java download9/8/2023 ![]() Xpath: new WebDriverWait(driver, and 'sampleFile')]"))).click() LinkText: new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.linkText("Download"))).click() ĬssSelector: new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("a#downloadButton"))).click() Ideally, to click() on the element you need to induce WebDriverWait for the elementToBeClickable() and you can use either of the following Locator Strategies: LinkText: driver.findElement(By.linkText("Download")).click() ĬssSelector: driver.findElement(By.cssSelector("a#downloadButton")).click() executor.executeScript("arguments.click() ", leftmenu) //clicking the left click() on the element Download you can use either of the following Locator Strategies: Here normal 'findElement' is not working, hence used the javascript leftmenu = executor = (JavascriptExecutor)driver WebDriverWait wait = new WebDriverWait(driver, globalDelay) I think this will let you clicking it with regular driver. ![]() Try adding a simple sleep after clicking it.Īlso, you should not use hardcoded pauses like this Thread.sleep(5000) Īlso please try to wait until the element is visible, as I wrote here. You are finishing the test run and closing the browser immediately after clicking the download button.
0 Comments
Read More
Leave a Reply. |