How to wait until an element is present in Selenium?

后端 未结 5 1599
情话喂你
情话喂你 2020-11-27 02:53

I\'m trying to make Selenium wait for an element that is dynamically added to the DOM after page load. Tried this:

fluentWait.until(ExpectedConditions.presen         


        
5条回答
  •  -上瘾入骨i
    2020-11-27 03:48

    WebDriverWait wait = new WebDriverWait(driver,5)
    wait.until(ExpectedConditions.visibilityOf(element));
    

    you can use this as some time before loading whole page code gets executed and throws and error. time is in second

提交回复
热议问题