我使用的是C#上的硒webdriver,我正在使用頁面對象模塊。現在我需要一個語法來明確地等待,因爲我已經擁有了webelement。顯式等待Selenium Webdriver用於手動元素
[FindsBy(How = How.Id, Using = "Passwd")]
public IWebElement Password {get;set;}
[FindsBy(How = How.Id, Using = "signIn")]
public IWebElement Signin { get; set; }
我需要等到找到元素密碼。
使用本模塊之前我用的是:
WebDriverWait wait = new WebDriverWait(driver.driver, TimeSpan.FromSeconds(Time));
wait.Until(ExpectedConditions.ElementExists(by));
現在我需要使用該元素在手。
在預期條件下不接受ElementToBeClickable。它給出.........'OpenQA.Selenium.Support.UI.ExpectedConditions'不包含'ElementToBeClickable –
的定義你可以看到這個鏈接的c#文檔,https://seleniumhq.github.io/ selenium/docs/api/dotnet/html/M_OpenQA_Selenium_Support_UI_ExpectedConditions_ElementToBeClickable_1.htm它由'ExpectedConditions'支持。我很奇怪你爲什麼會得到錯誤 –
你使用什麼版本的硒? –