java - Selenium webdriver wait, Element not clickable exception -


i using selenium webdriver chrome. testing web application lot of ajax contents after login application take seconds load ajax content in home page.

i've used explicit wait after login wait until finding element. fails mostly. i've given 25 seconds wait fails after 4 seconds of wait . error ,...

unknown error: element <a href="/ls/create_new" class="ajax adddashbutton haslink">...</a> not clickable @ point (144, 223).  

other element receive click: (session info: chrome=60.0.3112.78) (

my code ..

public class login {     webdriver driver;    @test   public void f() {        system.setproperty("webdriver.chrome.driver", "filepath/chromedriver");       driver = new chromedriver();   driver.get("url");   driver.manage().window().maximize();        driver.findelement(by.name("username")).sendkeys("username");       driver.findelement(by.name("password")).sendkeys("password");       driver.findelement(by.classname("login")).click();        webdriverwait wait = new webdriverwait(driver, 25);        wait.until(expectedconditions.presenceofelementlocated(by.linktext("create new app")));       driver.findelement(by.linktext("create new app")).click();   } } 

this part of code ..what correct way use webdriver wait. ty

intead of using presenceofelementlocated, try once visibilityofelementlocated .

  • visibilityofelementlocated: checks element should visible , present.
  • presenceofelementlocated: checks element present in dom or not.

for more information use can check below link- what exact difference between "expectedconditions.visibilityofelementlocated" , "expectedconditions.presenceofelementlocated"


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -