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」))); –