Wait for an element using Selenium webdriver

后端 未结 4 702
耶瑟儿~
耶瑟儿~ 2021-01-23 07:11

What is the best way to wait for an element to appear on a web page? I have read that we can use implicit wait and functions like webdriverwait, fluentwait etc and last but not

4条回答
  •  天命终不由人
    2021-01-23 07:33

    You could wait for the presence of the element to appear as follows:

    new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.id("someId")));
    

提交回复
热议问题