0

In a piece of code instead of

Thread.sleep (4000);

I want use

from wait.until (ExpectedConditions.visibilityOfElementLocated (By.xpath ("// div [@class = \" x-tool-img x-tool-expand-bottom x-rtl \ "]")));

and i see error but using Thread.sleep I do not have an error message and the code is easily passed i don't no why not pass with wait.until ??

Thank you for your guide

Vipul Gulhane
  • 761
  • 11
  • 16
  • What is the error? and please post the real code, this is not valid Java syntax. – Guy Oct 28 '18 at 06:50

2 Answers2

0

The valid syntax of wait can be found here: https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp

WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("someid")));
Infern0
  • 2,565
  • 1
  • 8
  • 21
0

Try to use this Valid Format.

WebDriverWait wait = new WebDriverWait(driver, 5);
WebElement e4 = wait.until(ExpectedConditions.visibilityOf(ElementtobeVisible));

or Check out this Link, it will be Helpful.

Bharadwaj Pendyala
  • 324
  • 1
  • 3
  • 16
koushick
  • 497
  • 2
  • 8
  • 30