2017-02-10 217 views
2

我是Selenium IDE的初學者。添加了插件並試圖運行測試用例。它給我看了下面的錯誤信息。無法啓動Selenium獨立服務器

[info] Test case failed 
[info] Test suite completed: 1 played, 1 failed 
[info] Playing test case My First TC 
[info] Executing: |open |/| | 
[error] Could not connect to Selenium Server. Have you started the Selenium Server yet? 

於是我下載了必需的jar文件並執行以下命令 Java的罐子硒的服務器獨立-2.28.0.jar

獲得一堆[與已下載了最新的版本替換]的消息如下:要做什麼?

硒的服務器獨立-3.0.1.jar

Java版本 java版 「1.8.0_111」 的Java(TM)SE運行時環境(建1.8.0_111-B14) 的Java熱點(TM)64位服務器VM(建立25.111-B14,混合模式)

23:20:37.675 INFO - Selenium build info: version: '3.0.1', revision: '1969d75' 
23:20:37.675 INFO - Launching a standalone Selenium Server 
2017-02-10 23:20:37.691:INFO::main: Logging initialized @275ms 
23:20:37.737 INFO - Driver class not found: com.opera.core.systems.OperaDriver 
23:20:37.737 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped: Unable to create new instances on this machine. 
23:20:37.737 INFO - Driver class not found: com.opera.core.systems.OperaDriver 
23:20:37.737 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered 
23:20:37.737 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped: registration capabilities Capabilities [{browserName=safari, version=, platform =MAC}] does not match the current platform VISTA 2017-02-10 23:20:37.769:INFO:osjs.Server:main: jetty-9.2.15.v20160210 
2017-02-10 23:20:37.800:INFO:osjsh.ContextHandler:main: Started o.s.j.s.Servlet[email protected]{/,null,AVAILABLE}2017-02-10 23:20:37.815:WARN:osjuc.AbstractLifeCycle:main: FAILED [email protected]{HTTP/1.1}{0.0.0.0:4444}: java.net.BindException: Address already in use: bind 
java.net.BindException: Address already in use: bind 
    at sun.nio.ch.Net.bind0(Native Method) 
    at sun.nio.ch.Net.bind(Unknown Source) 
    at sun.nio.ch.Net.bind(Unknown Source) 
    at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) 
    at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) 
    at 

org.seleniumhq.jetty9.server.ServerConnector.open(ServerConnector.java:321) 
     at org.seleniumhq.jetty9.server.AbstractNetworkConnector.doStart(Abstrac 
tNetworkConnector.java:80) 
     at org.seleniumhq.jetty9.server.ServerConnector.doStart(ServerConnector. 
java:236) 
     at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(Abstract 
LifeCycle.java:68) 
     at org.seleniumhq.jetty9.server.Server.doStart(Server.java:366) 
     at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(Abstract 
LifeCycle.java:68) 
     at org.openqa.selenium.remote.server.SeleniumServer.boot(SeleniumServer. 
java:147) 
     at org.openqa.grid.selenium.GridLauncherV3$1.launch(GridLauncherV3.java: 
229) 
     at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:91) 
2017-02-10 23:20:37.815:WARN:osjuc.AbstractLifeCycle:main: FAILED org.seleniumhq 
[email protected]: java.net.BindException: Address already in use: 
bind 
java.net.BindException: Address already in use: bind 
     at sun.nio.ch.Net.bind0(Native Method) 
     at sun.nio.ch.Net.bind(Unknown Source) 
     at sun.nio.ch.Net.bind(Unknown Source) 
     at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) 
     at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) 
     at org.seleniumhq.jetty9.server.ServerConnector.open(ServerConnector.jav 
a:321) 
     at org.seleniumhq.jetty9.server.AbstractNetworkConnector.doStart(Abstrac 
tNetworkConnector.java:80) 
     at org.seleniumhq.jetty9.server.ServerConnector.doStart(ServerConnector. 
java:236) 
     at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(Abstract 
LifeCycle.java:68) 
     at org.seleniumhq.jetty9.server.Server.doStart(Server.java:366) 
     at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(Abstract 
LifeCycle.java:68) 
     at org.openqa.selenium.remote.server.SeleniumServer.boot(SeleniumServer. 
java:147) 
     at org.openqa.grid.selenium.GridLauncherV3$1.launch(GridLauncherV3.java: 
229) 
     at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:91) 
Usage: <main class> [options] 
    Options: 
    -browserTimeout 
     <Integer> in seconds : number of seconds a browser session is allowed to 
     hang (0 means indefinite) while a WebDriver command is running (example: 
     driver.get(url)). If the timeout is reached while a WebDriver command is 
still processing, 
     the session will quit. Minimum value is 60. Default is 0 
    -debug 
     <Boolean> : enables LogLevel.FINE. Default is false (if omitted) 
     Default: false 
    -jettyThreads, -jettyMaxThreads 
     <Integer> : max number of threads for Jetty. Default is 200 
    -log 
     <String> filename : the filename to use for logging. If omitted, will log 

     to STDOUT 
    -port 
     <Integer> : the port number the server will use. Defaults to [4444]. When 

     "role" is a set to [node], default is [5555] 
     Default: 4444 
    -role 
     <String> options are [hub], [node], or [standalone] : Default is 
     [standalone] 
     Default: standalone 
    -timeout, -sessionTimeout 
     <Integer> in seconds : Specifies the timeout before the server 
     automatically kills a session that hasn't had any activity in the last X 
seconds. The 
     test slot will then be released for another test to use. This is typicall 
y 
     used to take care of client crashes. For grid hub/node roles, cleanUpCycl 
e 
     must also be set. Default is 1800 (30 minutes) 
     Default: 1800 

java.lang.RuntimeException: java.net.BindException: Address already in use: bind 

     at org.openqa.selenium.remote.server.SeleniumServer.boot(SeleniumServer. 
java:149) 
     at org.openqa.grid.selenium.GridLauncherV3$1.launch(GridLauncherV3.java: 
229) 
     at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:91) 
Caused by: java.net.BindException: Address already in use: bind 
     at sun.nio.ch.Net.bind0(Native Method) 
     at sun.nio.ch.Net.bind(Unknown Source) 
     at sun.nio.ch.Net.bind(Unknown Source) 
     at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) 
     at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) 
     at org.seleniumhq.jetty9.server.ServerConnector.open(ServerConnector.jav 
a:321) 
     at org.seleniumhq.jetty9.server.AbstractNetworkConnector.doStart(Abstrac 
tNetworkConnector.java:80) 
     at org.seleniumhq.jetty9.server.ServerConnector.doStart(ServerConnector. 
java:236) 
     at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(Abstract 
LifeCycle.java:68) 
     at org.seleniumhq.jetty9.server.Server.doStart(Server.java:366) 
     at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(Abstract 
LifeCycle.java:68) 
     at org.openqa.selenium.remote.server.SeleniumServer.boot(SeleniumServer. 
java:147) 
     ... 2 more 
+0

pid xx過程中解決了這個問題。只需在IDE選項中取消選中WebDriver選項即可 –

回答

0

這些都是幾步就可以申請和檢查工作或不

)下載硒獨立jar文件。

2)將jar文件粘貼到lib文件夾中。

3)項目 - >屬性 - > Java構建路徑 - >添加JAR->選擇獨立的jar文件 - >點擊OK

4)運行 - >外部工具 - >外部工具配置 - >新配置。

5)添加位置和工作目錄的java.exe和硒獨立的server.jar

6)點擊變量和添加參數作爲罐子硒 - 服務器 - 獨立-3.0.1.jar

7)點擊應用和運行....

8)在Eclipse控制檯中你會得到端口號,這將確認您發佈的硒獨立服務器

0

的硒開始時我有同樣的問題。我殺死其佔用的端口4444

  1. netstat -aon | findstr 4444 那麼你可以得到它佔據得到這個清除端口4444
  2. taskkill /T /F /pid xx
相關問題