【问题标题】:Selenium suites is not running on Chrome and running on FF?Selenium 套件不在 Chrome 上运行而在 FF 上运行?
【发布时间】: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


    【解决方案1】:

    使用 *googlechrome 在 Chrome 浏览器上运行。 并将包含“chrome.exe”或“google-chrome”的目录添加到您的 PATH 环境中。 注意 - 如果你只是说 *chrome 它将调用 Firefox Chrome。

    它也应该通过将“*googlechrome”参数更新为 - "*googlechrome C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

    【讨论】:

    • 完美!!所以我的案例 2 稍微正确,但我没有在路径前面包含 *googlechrome ..
    猜你喜欢
    • 2012-11-16
    • 1970-01-01
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多