How to wait until an element is present in Selenium?

后端 未结 5 1608
情话喂你
情话喂你 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条回答
  •  长情又很酷
    2020-11-27 03:40

    Let me recommend you using Selenide library. It allows writing much more concise and readable tests. It can wait for presence of elements with much shorter syntax:

    $("#elementId").shouldBe(visible);
    

    Here is a sample project for testing Google search: https://github.com/selenide-examples/google

提交回复
热议问题