我有以下代码。
IWebDriver webDriver = null;
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "ForceBindIP64.exe";
startInfo.Arguments = " -i 10.1.1.111 \"C:\\Program Files\\Mozilla Firefox\\firefox.exe\"";
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();
System.Uri = new System.Uri("http://localhost:7055/hub");
Thread.Sleep(5000);
webDriver = new RemoteWebDriver(uri, options);
我在这里尝试使用ForceBindIP绑定特定的IP,以及使用selenium Firefox驱动程序(即geckodriver)打开浏览器实例。在
webDriver = new RemoteWebDriver(uri, options);
处,我遇到以下异常错误。
我理解我得到以上错误可能是因为我定义的端口号可能是错误的,或者我将不得不使用Firefox驱动程序打开浏览器。也可能是其他原因。有人有解决方案吗?我将不得不通过ForceBindIP将由驱动程序打开的浏览器实例绑定到特定的IP。