Unable to launch Chrome in remote webdriver

浪子不回头ぞ 提交于 2019-12-13 08:04:10

问题


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 The HTTP request to the remote WebDriver server for URL http://100.100.10.100:5555/wd/hub/session timed out after 180 seconds.


回答1:


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

Its supposed to be:

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.

Learn more about it selenium grid commands break ups



来源:https://stackoverflow.com/questions/32221291/unable-to-launch-chrome-in-remote-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!