Add dependencies to your project

There are two ways of adding dependencies as well. You have to select the same method (manual or Maven) that you used to create the project in previous section.

Add manual dependencies

  1. Download the Java bindings as we are using Java to create our scripts.

  2. Create a new folder under the just created project and give it a meaningful name, like libs (as it will contain the project libraries). Right-click project -> new -> Folder


  3. Copy selenium-java-[latest-version].zip\selenium-[latest-version]\selenium-java-[latest-version].jar to libs.

  4. Copy also all jars from selenium-java-[latest-version].zip\selenium-[latest-version]\libs to libs directory.

  5. Select all dependencies in libs, right-click on them, and select Build Path -> Add to Build Path. Now, the dependencies are added to Referenced Libraries.


Use maven to manage dependencies

Now we need to add TestNG and Selenium as dependencies to our project. The are two ways of doing it: Right click on the project -> Maven -> Add Dependency. Search for selenium-java and double-click on the one from org.seleniumhq.selenium


Open the POM.xml file and add the following XML snippet between the <dependencies>...</dependencies> tags:



Selenium WebDriver:


Leave a Reply

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.