4

我在 Firefox 中使用 Selenium IDE 以 selenese 记录了一个测试套件,我想使用 Chrome 在命令行上运行这些测试。(我正在运行 Mac OS X)。

我显然做错了什么,因为当我尝试这样做时,它会在 Firefox 中运行。

我下载了 OS X 的 chromedriver 和 selenium-server-standalone jar 文件,并将它们都放在 /usr/local/bin 中。我认为以下命令确实需要我想要的,但它在 Firefox 而不是 Chrome 中运行测试。(注意,我正在测试运行在的本地应用程序http://localhost:8001)。

$ java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver \
 -jar /usr/local/bin/selenium-server-standalone-2.24.1.jar \
 -htmlSuite "*chrome" http://localhost:8001 /Users/lorin/selenium/suite.html /Users/lorin//selenium/results.html

输出如下所示:

Jun 19, 2012 4:32:40 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
16:32:45.880 INFO - Java: Apple Inc. 20.8-b03-424
16:32:45.881 INFO - OS: Mac OS X 10.7.4 x86_64
16:32:45.887 INFO - v2.24.1, with Core v2.24.1. Built from revision 17205
16:32:45.972 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
16:32:45.973 INFO - Version Jetty/5.1.x
16:32:45.973 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
16:32:45.974 INFO - Started HttpContext[/selenium-server,/selenium-server]
16:32:45.974 INFO - Started HttpContext[/,/]
16:32:46.018 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@3b75078b
16:32:46.018 INFO - Started HttpContext[/wd,/wd]
16:32:46.024 INFO - Started SocketListener on 0.0.0.0:4444
16:32:46.025 INFO - Started org.openqa.jetty.jetty.Server@6db3f829
jar:file:/usr/local/bin/selenium-server-standalone-2.24.1.jar!/customProfileDirCUSTFFCHROME
16:32:46.103 INFO - Preparing Firefox profile...
16:32:47.013 INFO - Launching Firefox...
16:32:47.734 INFO - Checking Resource aliases
16:33:00.781 INFO - Checking Resource aliases
16:33:00.783 INFO - Received posted results
16:33:01.537 INFO - Killing Firefox...
16:33:01.608 INFO - Shutting down...
4

2 回答 2

5

*googlechrome改为用于镀铬。那应该解决它。*chrome 用于在另一种模式下运行 firefox。

于 2012-06-19T22:51:37.900 回答
3

要在 Firefox 中运行它,您应该使用命令*chrome

要在 Chrome 中运行它,您应该使用命令*googlechrome

要在 Internet Explorer 中运行它,您应该使用*iexplore

于 2012-06-20T10:57:34.707 回答