0
我想明确地等待,直到我的元素启用点击屏幕。 但是目前发生的是元素是可见的,但由于加载符号驱动程序无法点击元素&代码失败。如果我使用暗指等待,然后代码工作。任何建议如何检查元素是否准备点击
WebDriverWait wait1 = new WebDriverWait(driver, new TimeSpan(0,0,60));
wait1.Until(ExpectedConditions.ElementSelectionStateToBe(By.XPath(GPDNav),true));
// wait1.Until(ExpectedConditions.ElementIsVisible(By.XPath(GPDNav)));
IWebElement gpdNav = driver.FindElement(By.XPath(GPDNav));
gpdNav.Click();
在预期的情况下,我们会像elementtobeclickable ...你能检查吗? –
不工作太..已尝试.. –
var wait = new WebDriverWait(driver,TimeSpan.FromMinutes(1)); var clickableElement = wait.Until(ExpectedConditions.ElementIsClickable(By.Id(“id”))); –