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
Download the Java bindings as we are using Java to create our scripts.
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
Copy selenium-java-[latest-version].zip\selenium-[latest-version]\selenium-java-[latest-version].jar to libs.
Copy also all jars from selenium-java-[latest-version].zip\selenium-[latest-version]\libs to libs directory.
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
POM.xml file and add the following XML snippet between the
<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.8.5</version> </dependency>
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>2.39.0</version> </dependency>