如何在以MAC为中心和Windows为Nod的网格中运行chrome浏览器? [英] How to run chrome browser in grid using MAC as hub and Windows as Nod?
问题描述
集线器:MAC 64位 点头:Windows 32位
Hub: MAC 64-bit Nod: Windows 32-bit
无法使用Selinum网格MAC作为集线器和Windows作为点头程序运行chrome浏览器?
Unable to run chrome browser using Selinum grid MAC as hub and Windows as nod?
使用下面的代码时出现错误(驱动程序可执行文件的路径必须由webdriver.chrome.driver系统属性设置;有关更多信息,请参见 http://code.google.com/p/chromedriver/downloads/list 命令持续时间或超时:668毫秒)
using below code i am getting an error (The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromedriver/downloads/list Command duration or timeout: 668 milliseconds)
public void chromeWindows() throws MalformedURLException{
System.setProperty("webdriver.chrome.driver", "/Users/vinayakkhatate/Desktop/jar/chromedriver2");
ChromeOptions opt = new ChromeOptions();
opt.setBinary("C:/Users/user/AppData/Local/Google/Chrome/Application/chrome.exe");
DesiredCapabilities capabilies = DesiredCapabilities.chrome();
capabilies.setBrowserName("chrome");
capabilies.setPlatform(Platform.VISTA);
driver = new RemoteWebDriver(new URL("http://10.0.11.118:5566/wd/hub"), capabilies);
driver.get(baseUrl);
System.out.println(driver.getTitle());
driver.close();
driver.quit();
}
推荐答案
我有将Chrome浏览器从Mac机器运行到Windows Vista的解决方案 (将chromedriver下载并保存在Windows Vista计算机中)
I have solution to run Chrome browser from Mac machine to Windows Vista (download and save chromedriver in windows vista machine)
使用以下命令在Mac中启动集线器
Start the hub in Mac with below command
java -jar selenium-server-standalone-2.33.0.jar -role hub
使用以下命令在Windows中启动节点
Start the node in windows with below command
java -jar selenium-server-standalone-2.33.0.jar -role node -hub http://localhost:4444/grid/register -maxSession 15 -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=5 -Dwebdriver.chrome.driver=pathtochromedriver\chromedriver.exe
现在在Mac机中的eclipse中编写代码
Now write code in eclipse in Mac machine
DesiredCapabilities capabilies = DesiredCapabilities.chrome();
capabilies.setBrowserName("chrome");
capabilies.setPlatform(Platform.ANY);
driver = new RemoteWebDriver(new URL("http://<ip address of windows machine>:5555/wd/hub"), capabilies);
这篇关于如何在以MAC为中心和Windows为Nod的网格中运行chrome浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!