org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with

前端 未结 7 1746
终归单人心
终归单人心 2020-12-30 13:33

I am trying to execute below Selenium Web driver script, But I am getting org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may n

7条回答
  •  时光取名叫无心
    2020-12-30 14:12

    Not sure what your requirement is. But, couple of things to keep in mind.

    1. Selenium may find the element that meets same criteria but they are hidden
    2. Even if element is not hidden it may not be in a ready state to accept any interaction.

    if you know for sure the element is not hidden then you can use the following wait for the element to be visible

     new WebDriverWait(Driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible("your selector"); 
    

提交回复
热议问题