Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 使用Chrome在命令行上运行selenese Selenium测试_Macos_Google Chrome_Command Line_Selenium - Fatal编程技术网

Macos 使用Chrome在命令行上运行selenese Selenium测试

Macos 使用Chrome在命令行上运行selenese Selenium测试,macos,google-chrome,command-line,selenium,Macos,Google Chrome,Command Line,Selenium,我在Firefox中使用Selenium IDE以selenese记录了一个测试套件,我想使用Chrome在命令行上运行这些测试。(我正在运行MacOSX) 我显然做错了什么,因为当我尝试这么做时,它会在Firefox中运行 我下载了chromedriver for OS X和selenium服务器独立jar文件,并将它们都放在/usr/local/bin中。我原以为下面的命令会满足我的要求,但它在Firefox而不是Chrome中运行测试。(注意,我正在测试一个运行在http://localh

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

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

我下载了chromedriver for OS X和selenium服务器独立jar文件,并将它们都放在/usr/local/bin中。我原以为下面的命令会满足我的要求,但它在Firefox而不是Chrome中运行测试。(注意,我正在测试一个运行在
http://localhost:8001

输出如下所示:

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...

使用
*googlechrome
代替chrome。这应该可以解决问题*chrome用于以另一种模式运行firefox

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

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


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

嗯,我不确定,因为我还没有尝试运行HTML套件。如果出现“chromedriver路径未找到”错误,请在命令中添加路径-Dwebdriver.chrome.driver=“pathtochromedriver”
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...