我是Selenium IDE的初学者。添加了插件,并试图运行测试用例。它向我显示了以下错误消息。
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.ServletContextHandler@5dfcfece{/,null,AVAILABLE}2017-02-10 23:20:37.815:WARN:osjuc.AbstractLifeCycle:main: FAILED ServerConnector@643b1d11{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
.jetty9.server.Server@2ef5e5e3: 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
所以我下载了必要的jar文件并执行了以下命令 java -jar selenium-server-standalone-2.28.0.jar [替换为下载的最新版本]
获取如下消息:要做什么?
硒 - 服务器 - 独立-3.0.1.jar
Java版 java版&#34; 1.8.0_111&#34; Java(TM)SE运行时环境(版本1.8.0_111-b14) Java HotSpot(TM)64位服务器VM(版本25.111-b14,混合模式)
java -cp ".;.\*" FirstKaaDemo
答案 0 :(得分:0)
这些是您可以应用的几个步骤,无论是否有效
)下载selenium独立jar文件。
2)粘贴到lib文件夹中的jar文件中。
3)project-&gt; properties-&gt; java build path-&gt;添加jar-&gt;选择独立的jar文件 - &gt;点击确定
4)运行 - >外部工具 - &gt;外部工具配置 - &gt;新配置。
5)为java.exe和selenium standalone server.jar
添加位置和工作目录6)点击变量并将Argument添加为-jar selenium-server-standalone-3.0.1.jar
7)点击申请并运行....
8)在Eclipse控制台中,您将获得端口号,这将确认您启动了selenium独立服务器
答案 1 :(得分:0)
启动硒时遇到同样的问题。我通过杀死占用端口4444的进程解决了这个问题。
netstat -aon | findstr 4444
然后你可以得到占据4444端口的pid xx
。taskkill /T /F /pid xx