wait.until(ExpectedConditions.visibilityOf Element1 OR Element2)

后端 未结 8 1130
遇见更好的自我
遇见更好的自我 2020-12-14 12:30

I want use wait.until(ExpectedConditions) with TWO elements. I am running a test, and I need WebDriver to wait until either of Element1 OR

8条回答
  •  旧巷少年郎
    2020-12-14 12:53

    There is an alternative way to wait but it isnt using expected conditions and it uses a lambda expression instead..

    wait.Until(x => driver.FindElements(By.Xpath("//h3[@class='... ']")).Count > 0 || driver.FindElements(By.Xpath("//h2[@class='... ']")).Count > 0); 
    

提交回复
热议问题