我正在使用硒 2.47.1。我下载了客户端和服务器,然后放入我的项目中。当我启动服务器时,它会记录以下信息:
java -jar selenium-server-standalone-2.47.1.jar
22:47:10.469 INFO - Launching a standalone Selenium Server
22:47:10.522 INFO - Java: Oracle Corporation 24.79-b02
22:47:10.522 INFO - OS: Linux 3.13.0-24-generic amd64
22:47:10.547 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
22:47:10.660 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match the current platform LINUX
22:47:10.660 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, browserName=MicrosoftEdge, version=}] does not match the current platform LINUX
22:47:10.661 INFO - Driver class not found: com.opera.core.systems.OperaDriver
22:47:10.661 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
22:47:10.766 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
22:47:10.766 INFO - Selenium Server is up and running
我看到了一些日志,然后我对这条线产生了怀疑:
registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match the current platform LINUX
- 为什么它有 Internet Explorer 设置。我在 ubuntu 14.04 上,我使用的是 firefox 和 chrome。
- 为什么说现在的平台不匹配LINUX。
随着服务器启动并运行,我运行了我的测试项目,这是错误:
org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'ok-ThinkPad-SL500', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.7.0_79'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:99)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:90)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:276)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:116)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:223)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:212)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at cucumber.features.StepDefinitions.navigateToHomePage(StepDefinitions.java:26)
at ✽.Given I navigate to the home site(/home/ok/workspace/CucumberPOC/src/cucumber/features/UserRegistry.feature:6)
我从SeleniumHQ下载了 selenium 服务器和客户端。