无法在远程WebDriver中启动Chrome [英] Unable to launch Chrome in remote webdriver

查看:532
本文介绍了无法在远程WebDriver中启动Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将2台PC设置为硒集线器&现在,我正在尝试从在集线器中运行的控制台应用程序浏览该节点中的URL.但是初始化浏览器时出现错误.两台PC均在Windows 7上运行.

I have set up 2 PCs as selenium hub & node.Now, I am trying to browse a URL in that node, from a console app that runs in the hub. But there is an error when initialising the browser.Both PCs run on windows 7.

//setting up the hub
Process.Start("cmd.exe", "/C java -jar selenium-server-standalone-2.47.1.jar -role hub");

//setting up the node
string Command1 = "/C cmdkey.exe /add:\\DES100 /user:abcd /pass:abcd123";
string Command2 = "psexec.exe \\DES100 -w D:\\Selenium java -Dwebdriver.chrome.driver=D:\\chromedriver.exe -jar selenium-server-standalone-2.47.1.jar -role node -hub http://hubip:4444/grid/register";
Process.Start("cmd.exe", string.Format("{0} && {1}", Command1, Command2));

//open the browser

//ERROR AT BELOW LINE
IWebDriver NewDriver = new RemoteWebDriver(new Uri("http://100.100.10.100:5555/wd/hub"), DesiredCapabilities.Chrome(),TimeSpan.FromSeconds(180));

ERROR到URL的远程WebDriver服务器的HTTP请求 http://100.100.10.100:5555/wd/hub/session 在180后超时秒.

ERROR The HTTP request to the remote WebDriver server for URL http://100.100.10.100:5555/wd/hub/session timed out after 180 seconds.

推荐答案

您正在将网格字符串放置在localhost:4444上,并且您的网络驱动程序URI指向:5555

You're string your grid on localhost:4444 and your webdriver URI is pointing to :5555

应该是:

IWebDriver NewDriver = new RemoteWebDriver(new Uri("http://100.100.10.100:4444/wd/hub"), DesiredCapabilities.Chrome(),TimeSpan.FromSeconds(180));

另外,通过打开浏览器并输入

Also make sure that your grid is launched by above line of code by opening your browser and typing

MachineIP:4444

此外,您还需要学习命令面包.

Also you need to learn command bread up.

详细了解 硒网格命令崩溃

这篇关于无法在远程WebDriver中启动Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆