C# 使用Chrome启动Selenium网格会话时出现问题,收到以下消息无法创建新服务:ChromeDriverService
我正在使用C#编写Selenium自动化脚本,我正在使用网格并尝试在服务器上运行脚本。我收到以下错误消息:C# 使用Chrome启动Selenium网格会话时出现问题,收到以下消息无法创建新服务:ChromeDriverService,c#,selenium,grid,C#,Selenium,Grid,我正在使用C#编写Selenium自动化脚本,我正在使用网格并尝试在服务器上运行脚本。我收到以下错误消息: System.InvalidOperationException: Unable to create new service: ChromeDriverService Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z' System info: host:
System.InvalidOperationException: Unable to create new service:
ChromeDriverService
Build info: version: '3.5.3', revision: 'a88d25fe6b',
time: '2017-08-29T12:54:15.039Z'
System info: host: 'USCDCSEL60', ip: '10.71.100.153', os.name: 'Windows
Server
2012 R2', os.arch: 'amd64',
os.version: '6.3', java.version: '1.8.0_144'
Driver info: driver.version: unknown (33)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response
errorResponse)
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.Remote.RemoteWebDriver..ctor(Uri remoteAddress,
ICapabilities desiredCapabilities, TimeSpan commandTimeout)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress,
ICapabilities desiredCapabilities)
at CRAFT.businesscomponents.GridTest.NetworkTest() in c:\Concept\Global
Intranet Automation\businesscomponents\GridTest.cs:line 73}
Here is my code :
Public void NetworkTest()
{
// Create a new instance of the Chrome driver.
// Notice that the remainder of the code relies on the interface,
// not the implementation.
// Further note that other drivers (InternetExplorerDriver,
// ChromeDriver, etc.) will require further configuration
// before this example will work. See the wiki pages for the
// individual drivers at http://code.google.com/p/selenium/wiki
// for further information.
IWebDriver driver = new RemoteWebDriver(new
Uri("http://10.71.100.153:4444/wd/hub"),
DesiredCapabilities.Chrome());
//Notice navigation is slightly different than the Java version
//This is because 'get' is a keyword in C#
driver.Navigate().GoToUrl("http://www.google.com/");
// Find the text input element by its name
IWebElement query = driver.FindElement(By.Name("q"));
// Enter something to search for
query.SendKeys("Cheese");
// Now submit the form. WebDriver will find the form for us from the
// element
query.Submit();
// Google's search is rendered dynamically with JavaScript.
// Wait for the page to load, timeout after 10 seconds
WebDriverWait wait = new WebDriverWait(driver,
TimeSpan.FromSeconds(10));
wait.Until((d) => { return d.Title.ToLower().StartsWith("cheese");
});
// Should see: "Cheese - Google Search"
System.Console.WriteLine("Page title is: " + driver.Title);
//Close the browser
driver.Quit();
}
}
}
集线器计算机看到脚本正在运行,但Chrome驱动程序服务未启动。我假设我的代码需要更多信息,比如Chrome驱动程序所在的目录 我假设节点正在运行并正确连接到集线器?连接集线器并正确注意..是的,节点和集线器已正确连接。是否正确编码用于正确连接集线器和节点的示例?连接节点时,我是否必须给出Chrome驱动程序在集线器上的位置?我假设节点正在运行并正确连接到集线器?连接您的集线器并正确注意..是的,节点和集线器连接正确通过编码示例正确连接集线器和节点?连接节点时,我是否必须给出Chrome驱动程序在轮毂上的位置?