What is the best way to avoid NoSuchElementException in Selenium?

后端 未结 9 601
时光说笑
时光说笑 2020-11-27 18:31

I have written few test cases in Selenium WebDriver using Java and execute them on grid (hub and multiple nodes). I have noticed that a few test cases fail due to NoSu

9条回答
  •  有刺的猬
    2020-11-27 19:07

    WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds);
    wait.until(ExpectedConditions.elementToBeClickable(By.id));
    

    elementToBeClickable waits for Enable and Visible of an Element

提交回复
热议问题