Selenium, Cucumber, JUnit, TestNG dependencies for Selenium project.

Author: neptune | 02nd-Apr-2023
#Selenium #Testing

If you are here then you definitely know what is pom.xml file, if not then POM stands for Page Object Model. 




When we create or convert the Selenium project into the Maven project the pom.xml file is added to the project root directory. POM maintains the dependencies of  Selenium, Cucumber, JUnit, TestNG, etc. 

If we need to update, add, or delete dependencies then we can easily do that with the help of a pom.xml file.




All you need to do is copy and paste the below dependencies in the pom.xml file in between the dependencies tag :


<dependencies>

// add selenium, cucumber any other dependencies

</dependencies>




1. Selenium Dependencies

For creating project on selenium we need to add below dependencies in our pom.xml file.

      <!-- These are the selenium-webdriver dependencies -->

<dependency>

<groupId>org.seleniumhq.selenium</groupId>

<artifactId>selenium-java</artifactId>

    <version>3.5.2</version>

</dependency>

<dependency>

<groupId>org.seleniumhq.selenium</groupId>

<artifactId>selenium-server</artifactId>

<version>3.5.2</version>

</dependency>

<dependency>

<groupId>org.seleniumhq.selenium</groupId>

<artifactId>selenium-chrome-driver</artifactId>

<version>3.5.2</version>

</dependency>

<dependency>

<groupId>org.seleniumhq.selenium</groupId>

<artifactId>selenium-remote-driver</artifactId>

<version>3.5.2</version>

</dependency>

    <!-- selenium-webdriver dependencies end -->




2. Cucumber Dependencies

If we want to use cucumber in our project then add the below dependencies in pom.xml.


<!-- These are the cucumber dependencies →

<dependency>

<groupId>info.cukes</groupId>

<artifactId>cucumber-java</artifactId>

<version>1.2.5</version>

</dependency>


  <!-- cucumber dependencies end -->





3. Cucumber-JUnit Dependencies

To include JUnit in our project we need to include below JUnit dependencies in the project.


     <!-- These are the cucumber-junit dependencies -->

<dependency>

<groupId>info.cukes</groupId>

<artifactId>cucumber-junit</artifactId>

<version>1.2.5</version>

</dependency>

      <!-- cucumber-junit dependencies end →


    <!-- These are the junit dependencies →

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>4.12</version>

</dependency>

         <!-- These are the junit dependencies -->





4.Cucumber-TestNG Dependencies

To include TestNG in our project we need to include below TestNG dependencies in the project.


<!-- These are the Cucumber-TestNG dependencies -->

<dependency>

<groupId>info.cukes</groupId>

<artifactId>cucumber-testng</artifactId>

<version>1.2.3</version>

</dependency>

<!-- Cucumber-TestNG dependencies end -->





Above all dependencies are basic dependencies for Selenium Maven Project using TestNG as a reporting tool. You can add more dependencies along with the above dependencies.




Complete pom.xml file


Check how to create Selenium project in eclipse here.

Thanks for Reading !!!



anonymous | June 26, 2022, 6:36 p.m.

Well explained👍


anonymous | June 3, 2022, 8:10 a.m.

log4j is no longer used now.


anonymous | March 8, 2022, 12:30 a.m.

Add log4j dependencies as well.



Related Blogs
Automate Ticket Booking in SpiceJet from Delhi to Bengaluru using Selenium and Cucumber.
Author: neptune | 08th-Aug-2023
#Selenium
We are going to automate a ticket booking using Selenium WebDriver and Cucumber BDD...

Roadmap To Become Test Automation Engineer
Author: neptune | 25th-Jun-2022
#Testing
When I was starting my journey in test automation, a lot of questions comes to my mind. Such as…. “From where do I start?” “Best tools to use?” “Which Programming language?” “How to plan your work?”...

5 Selenium Project Ideas & for Beginners in Automation Testing
Author: neptune | 30th-Mar-2023
#Selenium #Testing #Projects
In this article, we will discuss 5 interesting Selenium project ideas for beginners in automation testing...

How to use wait commands in Selenium WebDriver in Java ?
Author: neptune | 22nd-Feb-2022
#Selenium #Testing #Java
We are going to explore different types of waits in Selenium WebDriver. Implicit wait, Explicit wait, and Fluent wait with examples...

Top 50+ Selenium Interviews Questions 2023 based on Years of Experience
Author: neptune | 02nd-Apr-2023
#Selenium #Testing #Interview
Every interview difficulty is based on how many years of experience you have in that field. For the Selenium Automation Tester I have divided the question on the number of years of experience...

Different types of software testing ?
Author: neptune | 27th-Jul-2022
#Testing #IT
Testing is the process to improve the performance of software. Examples: Unit, Integration, Regression, Smoke, Alpha, Beta, System, Stress Performance, Object-Oriented Testing etc...

Top 10 Selenium Interview Questions with answers (2021).
Author: neptune | 02nd-Apr-2023
#Selenium #Interview
In this article I will cover top 10 Selenium interview questions...

Mostly asked Cucumber interview questions in selenium automation interviews.
Author: neptune | 02nd-Apr-2023
#Testing
We are going to explore widely asked Cucumber interview questions in selenium automation interviews...

How to create Selenium Cucumber Project in Eclipse.
Author: neptune | 25th-May-2022
#Selenium
First, divide the process into the various steps to understand working in brief of a project. Steps in brief: We’ll start with initializing the browser driver and then log in to the web page...

How to create a Selenium, Cucumber Automation project in Eclipse ?
Author: neptune | 02nd-Apr-2023
#Selenium #Testing
Problem Statement : Let’s consider this particular project where we will try automating the process of booking a flight ticket. Let’s get started and see how it’s done using Selenium...

Challenges faced in automating Web Applications using Selenium
Author: neptune | 02nd-Oct-2022
#Selenium #Testing
List of Challenges faced by testers using Selenium 1. Popup and Alert Handling, 2. Dynamic element Handling 3. Restricted to only Desktop Browsers Testing...

20 TestNG Interview Questions
Author: neptune | 17th-Dec-2022
#Selenium #Interview
There is always more than one test or method in the class. If we do not prioritize these tests or methods, then the methods are selected alphabetically and executed while execution...

What is Test Plan in Testing?
Author: neptune | 30th-Oct-2022
#Testing
A Test Plan Document mentions in detail the objective of testing along with other core information like the internal beta team, target market, hardware and resource requirements, etc...

Getting started with Selenium WebDriver.
Author: neptune | 02nd-Apr-2023
#Selenium #Testing
In this blog I will give you an overview of Selenium WebDriver and Also discuss about advantages and disadvantages of Selenium WebDriver...

Why we use Robot Class in Automation Testing?
Author: neptune | 23rd-Aug-2022
#Selenium
Robot class is used to generate native system input events for the purpose of automation testing. It is used to perform mouse and keyboard events on windows applications or popups...

Top 10 Selenium Interview Questions.
Author: neptune | 02nd-Apr-2023
#Selenium #Interview
Locator is a command that tells Selenium IDE which GUI elements (like Text Box, Buttons, Check Boxes etc) we are going to use or perform some automation task...

How to send POST request using Rest Assured framework in Java ?
Author: neptune | 26th-Mar-2023
#Selenium #API
Rest Assured is a popular Java-based framework that is used for testing RESTful web services. It provides a simple and intuitive API for sending HTTP requests and validating the responses...

5 Best Python Testing Frameworks.
Author: neptune | 12th-Apr-2023
#Python #Testing
Python offers various testing frameworks, including Pytest, unittest, Nose, Robot Framework, and Behave, to build robust and reliable software...

Getting Started with Cypress: Advantages, Setup, and First Test Guide
Author: neptune | 31st-Mar-2023
#Testing
Cypress is a powerful and easy-to-use testing framework that can help you test your web applications more efficiently...

How DAST Testing Enhances Web Application Security?
Author: neptune | 02nd-Aug-2023
#Testing
Dynamic Application Security Testing (DAST) is a critical cybersecurity technique used to identify and assess security vulnerabilities in web applications...

The Key to QA Success: Understanding How Important Grooming Is?
Author: neptune | 19th-Sep-2023
#Testing #Interview
We will delve into the importance of grooming & ceremony for QA testers, key points to highlight their significance...

View More