dolittle
dolittle

Reputation: 340

explicit wait not working properly

Explicit wait is not woking in the below line diver is waiting for only 70 to 100 milliseconds and error is displayed as element is not clickable :

WebDriverWait wait1=new WebDriverWait(driver,5000);
wait1.until(ExpectedConditions.elementToBeClickable(By.xpath("//span[@class='ui-button-icon-primary ui-icon ui-icon-triangle-1-s']")));
driver.findElement(By.xpath("//span[@class='ui-button-icon-primary ui-icon ui-icon-triangle-1-s']")).click();

Upvotes: 1

Views: 732

Answers (2)

Ssik
Ssik

Reputation: 96

In that case your Element is not clickable. Make sure the Xpath you are providing is correct.Consult the following question,make sure you are not making similar kind of mistake

How to resolve org.openqa.selenium.WebDriverException?

Upvotes: 1

Emna Ayadi
Emna Ayadi

Reputation: 2460

Try to add :

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

Upvotes: 1

Related Questions