情况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(您是否忘记添加 *?)
支持的浏览器包括: *firefox *mock *firefoxproxy *pifirefox *chrome *iexploreproxy *iexplore *firefox3 *safariproxy *googlechrome *konqueror *firefox2 *safari *piiexplore *firefoxchrome *opera *webdriver *iehta *custom
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 上运行