Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
2.9k views
by Expert (572 points)
retagged by
I am getting below exception while starting the selenium standalone server.

23:30:57.043 INFO - Selenium build info: version: '3.4.0', revision: 'unknown'
23:30:57.043 INFO - Launching a standalone Selenium Server
2017-06-22 23:30:57.074:INFO::main: Logging initialized @366ms to org.seleniumhq
.jetty9.util.log.StdErrLog
23:30:57.152 INFO - Driver class not found: com.opera.core.systems.OperaDriver
23:30:57.152 INFO - Driver provider com.opera.core.systems.OperaDriver registrat
ion is skipped:
Unable to create new instances on this machine.
23:30:57.152 INFO - Driver class not found: com.opera.core.systems.OperaDriver
23:30:57.168 INFO - Driver provider com.opera.core.systems.OperaDriver is not re
gistered
23:30:57.168 INFO - Driver provider org.openqa.selenium.safari.SafariDriver regi
stration is skipped:
 registration capabilities Capabilities [{browserName=safari, version=, platform
=MAC}] does not match the current platform WIN8_1
2017-06-22 23:30:57.230:INFO:osjs.Server:main: jetty-9.4.3.v20170317
2017-06-22 23:30:57.293:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletC
ontextHandler@1d057a39{/,null,AVAILABLE}
Usage: <main class> [options]
  Options:
    --version, -version
       Displays the version and exits.
       Default: false
    -browserTimeout
       <Integer> in seconds : number of seconds a browser session is allowed to
       hang while a WebDriver command is running (example: driver.get(url)). If
the
       timeout is reached while a WebDriver command is still processing, the ses
sion
       will quit. Minimum value is 60. An unspecified, zero, or negative value m
eans
       wait indefinitely.
       Default: 0
    -debug
       <Boolean> : enables LogLevel.FINE.
       Default: false
    -jettyThreads, -jettyMaxThreads
       <Integer> : max number of threads for Jetty. An unspecified, zero, or
       negative value means the Jetty default value (200) will be used.
    -log
       <String> filename : the filename to use for logging. If omitted, will log

       to STDOUT
    -port
       <Integer> : the port number the server will use.
       Default: 4444
    -role
       <String> options are [hub], [node], or [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: 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:
238)
        at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:99)
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:298)
        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:431)
        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

1 Answer

0 like 0 dislike
by
It looks like the port 4444 is already occupied.

Workaround:

If you have any other application, running on the port 4444, you should close that application first. Or use --port <your port> argument after java -jar selenium-standalone-server.jar file to use different port.

Or, your previous server/grid might not have shut down properly. In that case, you can open performance monitor. Go to process tab and close any running Java process. This is little risky as there are chances that other application will be using Java as well. So, you will see more than 1 Java process. So, be careful before ending any process. Or you can use the different port by using --port argument as mentioned above.

Hope that helps.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...