は、だから私はこの素晴らしい機能を使用して開始しました:SeleniumのC#ポートでWebDriverWaitのFindsByアノテーションを使用する方法はありますか?
[FindsBy(How = How.CssSelector, Using = "div.location:nth-child(1) > div:nth-child(3)")]
public IWebElement FirstLocationTile { get; set; }
しかし、問題は、私のWebDriverWaitコードで動作するようには思えないということです!
私のFirstLocationTileを再利用できない具体的な例です。それは持っていることを主張する:
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(BaseTest.defaultSeleniumWait));
wait.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("div.location:nth-child(1) > div:nth-child(3)")));
アイデア?
私はC#を使用しませんが、ExpectedConditionsの多くが 'WebElement'ではなくByだけを受け入れることを知っています。しかし、Javaでは、要素が表示されるまで待つ(存在しない、可視にする)ことは、WebElementでできることです。 –
FindsByはすべてのWeb要素でエラーが発生するように試みました。 FindElement(By.Id/Xpath work。[JavaのPageFactoryの例](http://startingwithseleniumwebdriver.blogspot.com.au/2015/02/wait-in-page-factory.html)。PageFactoryのinit要素はどこにありますか?どのような種類の[待機](http://automationtricks.blogspot.com.au/2015/02/what-is-implicit-home.php)は、 explicit-fluent-wait.html)? – lloyd