SeleniumのChrome WebdriverとC#を使用してWebサイトへのログインを自動化しようとしています。次のコードを実行すると、スクリーンショット1と2に記載されているエラーがスローされます。私は間違って何をしていますか?エラーのグーグルは関連する結果を表示していないようです。Selenium Chrome Webdriverが動作しない
using System.Drawing.Imaging;
using System.IO;
using OpenQA.Selenium.Chrome;
namespace WebDriverTest
{
class Program
{
static void Main(string[] args)
{
// Initialize the Chrome Driver
using (var driver = new ChromeDriver())
{
// Go to the home page
driver.Navigate().GoToUrl("https://twitter.com/");
// Get User Name field, Password field and Login Button
var userNameField = driver.FindElementById("usr");
}
}
}
}
An unhandled exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll.
Additional information: A exception with a null response was thrown
sending an HTTP request to the remote WebDriver server for
URL http://localhost:61724/session/cc7bae393b288855ed8169dade774baa/element.
The status of the exception was ReceiveFailure, and the message was:
The underlying connection was closed: An unexpected error occurred on a receive.
私はこれがバージョンの不一致だと思います。あなたが使用しているchromeとchromeのドライバのバージョンは何ですか? 私は最新のchrome 56とchrome driver 2.28で試してみることをお勧めします。 57クロムのようないくつかの問題があるかもしれないように見えます。 –