5

This may sound like stupid question but I want to know difference between Selenium standalone Server and Java selenium Jar file? I am able to import Webdriver class by using both jar files. If selenium Standalone server is providing all required jar file then why do we have separate Java selenium Jar files

SeleniumHQ

  • which jars should i use if I want to automate using selenium RC, locally? I know for RC, the server is always required even if you automate locally. So i have to use both selenium-server and client aswell? – anandhu Dec 13 '19 at 04:44

2 Answers2

5

Selenium Standalone Server - is an java jar file which is used for starting selenium server which is as word say server, proxy to selenium grid for browsers you want to automate.

Server is good for several reasons:

  1. Test distribution over remote machine, or multiple machines (nodes),
  2. Test on different browsers with different versions,
  3. Test that are not developed using the Java bindings (i.e. Python, C#, or Ruby) and would like to use HtmlUnit Driver
  4. 4.

Selenium Client (jar) - is as word say, an client, bunch of API's rolled into one jar, for different languages (Ruby, Phyton, C#, Javascript etc.) So if You want to automate locally and test on browser, one version of it, don't want to run in parallel, this is all You need.

Client jar can also be acquired by tools like maven or gradle, open-source build automation systems.

<!-- https://mvnrepository.com/artifact/io.appium/java-client -->
<dependency>
    <groupId>io.appium</groupId>
    <artifactId>java-client</artifactId>
    <version>6.0.0-BETA5</version>
</dependency>
Kovacic
  • 1,473
  • 6
  • 21
3

Selenium Client & WebDriver Language Bindings

In order to create local Selenium WebDriver scripts, you need to make use of language-specific client drivers. When using Selenium Java Binding Art you can use the jars published as Selenium Java Client

Whether you need the Selenium Server or not depends on how you intend to use Selenium-WebDriver. If your browser and tests will all run on the same machine, and your tests only use the WebDriver API, then you do not need to run the Selenium-Server; WebDriver will run the browser directly.

Selenium Standalone Server

There are some reasons though to use the Selenium-Server i.e. Selenium Standalone Server with Selenium-WebDriver.

  • If you are using Selenium-Grid to distribute your tests over multiple machines or virtual machines (VMs).
  • If you want to connect to a remote machine that has a particular browser version that is not on your current machine.
  • If you are not using the Java bindings art (i.e. C#, Ruby, Python, Javascript) and would like to use HtmlUnit Driver.
  • If you are using DefaultSelenium (or the RemoteWebDriver implementation), you still need to start a Selenium Server. The best way is to download the selenium-server-standalone.jar from the Selenium Downloads page and use it.
  • You can also embed the Selenium Server into your own project, if you add the following dependency to your pom.xml:

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.12.0</version>
    </dependency> 
    

    Now you can create a SeleniumServer instance yourself and start it.

Note : selenium-server artifact has a dependency to the servlet-api-3.1.0 artifact, which you should exclude, if your project will be run inside a web application container.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352