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.

Go to the selenium release download page to download the selenium server standalone jar file in the version folder that meets your needs. Please note not all version folder contains the selenium server standalone jar file.

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.

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. When I wrote this article, the latest stable jar file is selenium-server-standalone-3.141.59.jar.

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.

Right-click the eclipse java project name, and click the Properties menu item in the popup menu.

Click the Java Build Path in the left panel of the popup project properties dialog.

Click the Libraries tab in the right panel. Then click the Add External JARs button on the right panel to select the downloaded selenium server standalone jar file.

Click the OK button to save the changes. 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.

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.

The selenium server standalone jar file is commonly used for the selenium grid. 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.

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.

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>

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.

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\.

4. Video Demo For This Article.

You can watch this example’s demo video below.

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.