私はC#でselenium webdriverを使用していますが、私はページオブジェクトモジュールを使用しています。今私は、すでにweb要素を手にしているので、明示的な待機で使用する構文が必要です。明示的に待機する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));
今、私が手に要素を使用する必要があります。
Expected条件でElementToBeClickableが受け入れられません。それは......... 'OpenQA.Selenium.Support.UI.ExpectedConditions'には 'ElementToBeClickable –
'の定義が含まれていません。このリンクはc#docs、https://seleniumhq.github.io/で見ることができますselenium/docs/api/dotnet/html/M_OpenQA_Selenium_Support_UI_ExpectedConditions_ElementToBeClickable_1.htmこれは 'ExpectedConditions'でサポートされています。私は奇妙ですなぜあなたはエラーを取得しています –
セレンのどのバージョンを使用していますか? –