当前位置: 首页 > 知识库问答 >
问题:

无法启动Selenium独立服务器

王念
2023-03-14

我是Selenium IDE的初学者。添加了插件,并试图运行一个测试用例。它向我显示了下面的错误消息。

[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-jar selenium-server-standalone-2.28.0。jar[替换为下载的最新版本]

收到的信息如下:该怎么办?

selenium-server-standalone-3.0.1。罐子

Java版本java版本"1.8.0_111"Java(TM)SE运行时环境(构建1.8.0_111-b14)JavaHotSpot(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.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

共有2个答案

徐鑫鹏
2023-03-14

我在启动selenium时也遇到了同样的问题。我通过终止占用4444端口的进程解决了这个问题。

  1. netstat-aon|findstr 4444然后可以获取占用端口4444的pid xx
  2. taskkill /T /F /pidxx
宁侯林
2023-03-14

这些是几个步骤,你可以申请和检查工程与否

)下载selenium独立jar文件。

2) 将jar文件粘贴到lib文件夹中。

3) 计划-

4) 跑-

5) 为java添加位置和工作目录。exe和selenium独立服务器。罐子

6) 单击变量并添加参数-jar selenium-server-standalone-3.0.1。罐子

7) 点击应用并运行。。。。

8)在Eclipse控制台中,您将获得端口号,这将确认您启动硒独立服务器

 类似资料:
  • 问题内容: 在我的VPS上启动selenium独立服务器时遇到麻烦 输出: 此后没有更多输出。在本地,相同的命令就像一个超级按钮一样工作。任何提示如何解决此问题? 爪哇 更新1 该服务根本不在任何端口上运行 Netstat输出 更新2 好的,这里的主要问题是selenium服务器在启动时卡住了,我不知道为什么。我销毁了我的VPS机器并从头开始。selenium服务器启动一次,在我停止并再次启动后,

  • 问题内容: 我在新的数字海洋ubuntu 14.04服务器上部署了selenium独立服务器。它无法正常启动。它给出的日志是 我猜在日志中缺少2行。 有人知道为什么会发生吗? 问题答案: 当硒试图产生随机种子时会发生这种情况,但是内核缺乏熵。 解决方案是安装类似的添加熵的软件。参见https://www.digitalocean.com/community/tutorials/how- to-se

  • 问题内容: 我正在尝试运行selenium服务器,并出现错误: 没有-r(反正是什么?) 我应该如何启动服务器? 如何设置非默认端口来收听? 这两篇文章:1 2-关于语法矛盾。我认为。 问题答案: 如果要指定端口,请执行 从3.8.1开始,不再需要指定驱动程序:

  • 问题内容: 码头工人给我一个困难时期。我按照以下说明进行操作,以便在运行由strato.de托管的Ubuntu 14.04的虚拟服务器上安装docker。 执行此行直接将我带入此错误消息: 安装完成后,我安装了上述两个软件包。现在我的问题是我无法让docker运行。 结果是: 结果是 和 结果是 有人对缺少哪些依赖项有任何线索吗?还有什么可能出问题了?码头工人是否提供任何日志? 我正在来回寻找解决