我有硒问题,找不到这些元素。Java/Selenium代码查找元素: Wait().until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("[data-e2e-selector='saksjournal-poster']")));
return d
在我的测试中,一些通过css selector定位的元素需要很长时间才能出现,因为服务器非常慢。在通过jenkins运行测试时,我经常会遇到这个错误,而不是在eclipse上本地运行。org.openqa.selenium.TimeoutException: Expected condition failed:
> waiting for visibility of element located by By.cssSelectoructlSettingUpPaymentCollectionGrid1_gvGroup_ctl02_deleteGroup
我使用WebElement.findElement(By.cssSelector('')).click();在页面上查找元素,但它返回"Unable to locate element",但当我使用WebDriver.findElement(By.cssSelector('')).click();时,它能够找到该元素并单击它。