我的系统里安装了铬。我正在使用Selenium对chrome进行一些测试。
我已经把Chromedriver.exe下载到MyDocuments了。我使用webdriver.chrome.driver()设置了‘System.setProperty’,并启动了ChromeDriver()。效果很好。
System.setProperty("webdriver.chrome.driver", "C:\\MyDocuments\\chromedriver.exe");
driver=new ChromeDriver();现在,我正在尝试将Chromedriver.exe放到远程机器'https://remotemachine/chromedriver.exe'中。当我设置系统属性并启动ChromeDriver()时,我得到了一个异常,其中Selenium在一个奇怪的路径中搜索铬:
C:\User.\Appdata\Local\Google\Application.\https://remotemachine/chromedriver.exe中不存在webdriver.chrome.driver定义的色驱动程序可执行文件
为什么Selenium通过将系统属性附加到C驱动器中的某个位置来搜索chromedriver.exe?
如何使用远程chromedriver.exe文件从Selenium启动Chrome?
与上述无关,但:
是否也可以使用Java/Selenium找到默认的浏览器二进制路径?
发布于 2012-05-11 10:23:45
它希望chrome在windows中的这个位置。
%HOMEPATH%\AppData\Local\Google\Chrome\Application\chrome.exe
对于远程,它必须位于路径中,或者-Dwebdriver.chrome.driver值应该指向本地chromedriver.exe位置。
本地的,就像它正在运行的地方一样。
以下是安装程序的链接:http://code.google.com/p/selenium/wiki/RemoteWebDriver http://code.google.com/p/selenium/wiki/ChromeDriver
发布于 2012-05-15 03:59:43
您不能设置远程计算机的系统路径,例如-
System.setProperty("webdriver.chrome.driver", "remotemachine/chromedriver.exe");。
这段代码只会在它所在的集线器/本地机器上执行。
要远程运行它,需要在启动WD节点时提到-Dwebdriver.chrome.driver=pathtochromedriver.exe。
java -jar seleniumserver.jar -role wd -hub http://hubhost:port/grid/register -Dwebdriver.chrome.driver=pathtochromedriver发布于 2012-05-24 10:22:26
Settings\sssuppaluri\Desktop\Spicejet_Automation\chromedriver.exe");System.setProperty("webdriver.chrome.driver“、"C:\Documents和ChromeDriver驱动程序=新的ChromeDriver()”;driver.get(“https://149.122.160.94:8443/skylights/cgi-bin/skylights.cgi"”);
https://stackoverflow.com/questions/10548795
复制相似问题