Visual Studio 2017内でSelenium.WebDriver
v3.7(NuGet)、Firefox ESR v52.4.1(64ビット)、geckodriver v0.19.1をフックしようとしています。非常に簡単なテストコンソールアプリケーションです。私のWindows 10 PATH
システム環境変数に追加なぜSeleniumはタイムアウトしますか?
public class Program
{
public static void Main(string[] args)
{
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"C:\geckodriver\0.19.1");
service.FirefoxBinaryPath = @"C:\Program Files\Mozilla Firefox\firefox.exe";
IWebDriver driver = new FirefoxDriver(service);
driver.Navigate().GoToUrl("http://news.bbc.co.uk");
}
}
geckodriverディレクトリがもです。
ただし、FirefoxDriver
のインスタンス化はタイムアウトします。以下は(検閲無関係な内容のカップルと)スタックトレースです:
1510233068873 geckodriver INFO geckodriver 0.19.1
1510233068878 geckodriver INFO Listening on 127.0.0.1:65327
1510233070006 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\x\\AppData\\Local\\Temp\\rust_mozprofile.qt9HYniTrrCC"
Unhandled Exception: OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:65327/session timed out after 60 seconds. ---> System.Net.WebException: The request was aborted: The operation has timed out.
at System.Net.HttpWebRequest.GetResponse()
at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
--- End of inner exception stack trace ---
at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxDriverService service)
at Selenium3Stuff.Program.Main(String[] args) in c:\users\x\source\repos\Selenium3Stuff\Selenium3Stuff\Program.cs:line 12
誰も私が何が起こっているか理解するのに役立つことはできますか? FirefoxDriver
をUseLegacyImplementation
オプションをtrueに設定して作成すると(つまり、geckodriverをバイパスすると)、すべて正常に動作します。
タイムアウトは、ブラウザがドライバに応答できないために発生するために発生します。これはおそらく、使用しているドライバのバージョンがESR 52と互換性がないためです。推奨最小バージョンは55です。 –
oo ... good info @FlorentB。お勧めのバージョン情報のソースを教えてください。 – Mark
リリースv0.19.0のコメントを確認してください:https://github.com/mozilla/geckodriver/releases –