Grishma Oswal
Grishma Oswal

Reputation: 303

how to find how much time explicit wait took for condition to be true in selenium web driver java

WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("someid")));

How long did the driver wait for this condition to be true?

Upvotes: 1

Views: 162

Answers (1)

AdamSkywalker
AdamSkywalker

Reputation: 11619

Try this

WebDriverWait wait = new WebDriverWait(driver, 10);
long startTime = System.currentTimeMillis();
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("someid")));
long durationMs = System.currentTimeMillis() - startTime;

Upvotes: 1

Related Questions