Site icon Letzdotesting

Download Selenium Dependencies

Hello Everyone, in this post will learn how to download Selenium dependencies using Gradle.

Selenium dependencies/JAR files are required to run a web automation testing in IntelliJ. Downloading the libraries and adding those to the project’s build path one by one is a tedious and time-consuming process. To overcome this problem, we are going to use Gradle, a powerful build management tool which helps in the automatic download and configuration of dependencies or other libraries.

Pre-requisite : 

To download Selenium dependencies, we need to create a Gradle project in IntelliJ.

Create New Gradle Project in IntelliJ

Step 1: Launch IntelliJ by double-clicking the application

Step 2: Click Create New Project

Step 3: In the next screen,

  1. Select Gradle
  2. IntelliJ automatically adds Project SDK (JDK)
  3. JAVA (Default option)
  4. Click Next

Step 4: Enter ArtifactId and Click Next

Note: ArtifactId is basically our Project Name

Step 5: In the next screen,

Step 6: Click Finish

Step 7: New Gradle Project has been created successfully. Project Structure should exactly look similar.

Download Selenium Dependencies

Following Selenium dependencies are required to run an automation test,

Step 1: Open the build.gradle file 

Step 2: Let’s understand the build.gradle file quickly. Two important sections to note down are,

Step 3: Navigate to https://mvnrepository.com/

Step 4: Search for ‘Selenium’ in the search box and click Search

Step 5: You should see the search results as below,

Step 6: Click Selenium Java -> Select latest version – > Select Gradle tab

Step 7: Copy the text and paste in the build.gradle file under the dependencies section

After you pasted the code, Gradle automatically triggers the selenium dependency download and add the required Selenium JAR files to the project. Selenium JAR files are found under External Libraries section.

Step 9: build.gradle file should exactly look similar.

Selenium Dependencies are downloaded successfully!

Troubleshooting tips

If dependencies are not downloaded,

Know anyone who would like to learn Cucumber (BDD) Automation Testing tool for enhancing their career? Let them know by sharing this article on Facebook, Twitter, or Google Plus.

Exit mobile version