【发布时间】:2012-12-03 09:43:31
【问题描述】:
案例 1:
使用时:
C:\Program Files (x86)\Java\jdk1.7.0\bin>java -jar C:\selenium\selenium-2.25.0\selenium-server-standalone-2.25.0.jar -htmlSuite "*googlechrome" https://accounts.google.com/ "C:\selenium\Ide\test_suite.htm" "C:\selenium\Ide\results.htm"
获取异常:
看到的 HTML 套件异常:java.lang.RuntimeException: java.lang.RuntimeException:无法在 Google Chrome 中找到 小路!请添加包含“chrome.exe”的目录或 'google-chrome' 或 'Google Chrome'' 到你的 PATH 环境 变量,或显式指定 Google Chrome 的路径,如下所示: *googlechrome c:\blah\chrome.exe
案例 2
如此改变
C:\Program Files (x86)\Java\jdk1.7.0\bin>java -jar C:\selenium\selenium-2.25.0\selenium-server-standalone-2.25.0.jar -htmlSuite "C: \Program Files (x86)\Google\Chrome\Application\chrome.exe" https://accounts.google.com/ "C:\selenium\Ide\test_suite.htm" "C:\selenium\Ide\results.htm"
获取:
看到的 HTML 套件异常: java.lang.RuntimeException:不支持浏览器:C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (你忘了加*吗?)
支持的浏览器包括: *火狐 *嘲笑 *火狐代理 *pifirefox *铬合金 *iexploreproxy *探索 *火狐3 *safariproxy *谷歌浏览器 *征服者 *火狐2 *苹果浏览器 *pii探索 *火狐浏览器 *歌剧 *网络驱动程序 *iehta *自定义
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.browserNotSupported(BrowserLauncherFactory.java:151)
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(BrowserLauncherFactory.java:127)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.getBrowserLauncher(HTMLLauncher.java:78)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:138)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:196)
at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:612)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:286)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:244)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)
23:23:19.194 信息 - 正在关闭...
案例 3
所以用浏览器再次更改为 *chrome
它应该在 chrome 上运行,但它在 Firefox 上运行
【问题讨论】:
标签: selenium