How To Add Selenium Server Standalone Jar File Into Eclipse Java Project And Maven Project

This article will show you how to add the selenium server standalone java library into the eclipse java project and how to import selenium webdriver java jar files into the eclipse maven project.

1. Download The Selenium Server Standalone Jar File Which Includes The Webdriver API.

  1. Go to the selenium release download page to download the selenium server standalone jar file in the version folder that meets your needs.
  2. Please note not all version folder contains the selenium server standalone jar file.
  3. There are different versions of selenium server standalone jar files. Not all the versions run well with the Firefox browser. You can download the jar file which is most fit your web browser. This is the Firefox web browser download link.
  4. If you want to get the latest stable selenium server standalone jar file, you can go to the page https://www.selenium.dev/downloads/ in Selenium Server ( Grid ) section, because the selenium server standalone jar file is usually used in the selenium grid.
  5. When I wrote this article, the latest stable jar file is selenium-server-standalone-3.141.59.jar.
  6. Save the download jar file to a local folder such as D:\Work\dev2qa.com-example-code\2021ExampleProject\2021JavaExampleProject\RequiredLibs\selenium-server-standalone-3.141.59.jar

2. How To Add The Selenium Server Standalone Jar File To Eclipse Java Project.

  1. Right-click the eclipse java project name, and click the Properties menu item in the popup menu.
  2. Click the Java Build Path in the left panel of the popup project properties dialog.
  3. Click the Libraries tab in the right panel.
  4. Then click the Add External JARs button on the right panel to select the downloaded selenium server standalone jar file.
  5. Click the OK button to save the changes.
  6. You can find the added selenium server standalone jar file under the eclipse java project / Referenced Libraries folder in the eclipse left side Project Explorer panel.
  7. Now you had added the jar file to your java project. It includes all the selenium and webdriver Java API. You can create your java program for test automation now.

3. How To Add Selenium WebDriver Jar Files In Eclipse Maven Project.

  1. The selenium server standalone jar file is commonly used for the selenium grid.
  2. If you want to develop a java program that uses selenium to automate web browser action, you can add the selenium jar files in the eclipse maven project.
  3. Open eclipse, and click the menu item File —> New —> Maven Project to create an eclipse maven project. You can read the article How To Create Maven Project In Eclipse to learn more.
  4. Add the below dependency in the maven project pom.xml file between <project>…… </project>.
    <dependencies>
      <dependency>
         <groupId>org.seleniumhq.selenium</groupId>
         <artifactId>selenium-java</artifactId>
         <version>3.141.59</version>
       </dependency>
    </dependencies>
  5. Click the save button to save the eclipse maven project, when the eclipse project build process is complete, you can find related selenium jar files under the maven project / Maven Dependencies folder.
  6. Usually, the Maven Dependencies library jar files are saved in the directory C:\Users\user-name\.m2\repository\ on windows. For Linux or macOS, the folder should be $user_home\.m2\repository\.
  7. You can browse the URL How to add selenium server standalone jar file into your java project to see this example’s demo video.

1 thought on “How To Add Selenium Server Standalone Jar File Into Eclipse Java Project And Maven Project”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Clicky