Selenium WebDriverWait 类在添加 Selenium PhantomJS 时不可用



我正在尝试在我的测试中使用Selenium的WebDriverWait和Selenium PhantomJSDriver。 在添加Selenium.WebDriver包时,该类是可用的(在OpenQA.Selenium.Support.UI下( 当我添加Selenium.WebDriver.PhantomJS.Xplatform软件包时,它变得无法使用。

如果我切换添加上述软件包的顺序(使用Rider通过Nuget管理两次(,Selenium.WebDriver将使OpenQA.Selenium.PhantomJS无法访问。 我还添加了Selenium.Support,如下所示:在OpenQA.Selenium(C#(中找不到WebDriverWait类,但这没有帮助。

关于如何将WebDriverWait与PhantomJS一起使用的任何建议?

PhantomJS已被弃用好几年了。改用无头镀铬

ChromeOptions options = .ChromeOptions()
options.AddArguments("headless");
IWebDriver driver = new ChromeDriver(options));

最新更新