Automate Ticket Booking in SpiceJet from Delhi to Bengaluru using Selenium and Cucumber.

Author: neptune | 27th-Jan-2023 | Views: 7292
#Selenium #Cucumber

In this article we will automate the ticket booking scenario on SpiceJet website.

First of all, you need to create a maven project in eclipse or IntelliJ IDE then add all the cucumber, TestNG, and other dependencies in the pom.xml file.

Check dependencies here.


Then Follow these steps and create the required classes and feature files:-

1. Create a Cucumber file (SpiceJetTicketBooking.feature)

In feature file we write the general english sentences using a Gerkins language. Gerkins has specific keywords like Given, When, Then, and And. We have to write sentences in english followed by these keywords as shown below. Now create the cucumber feature file and copy the below steps or write your own steps.  


2. Create StepDef class(SpiceJetStepDef.java)

In this class we write the Java methods for the steps defined in above cucumber file. Each step will have one definition or Methods that's why we call it step definitions.

Create a step definitions for above steps in step definition package.




3. Create TestRunner file (TestRunner.java)

In TestRunner.java contains the path of the feature file and step definitions that you want to execute. Basically it link our cucumber steps, step definitions and other reports package or folders. It will also run the project.


Hoping that you enjoyed reading this post and working on the project. Working on hands-on automation projects like this one is the best way to sharpen your skills.

I hope you have learned something new today. 

Thanks for Reading !!!




anonymous | June 23, 2022, 10:32 p.m.

Really helpful 👍


anonymous | April 15, 2022, 3:01 p.m.

Add more details


anonymous | Feb. 18, 2022, 12:33 p.m.

Nice Content


anonymous | Sept. 8, 2021, 11:41 a.m.

Try to check locator for date


anonymous | Aug. 31, 2021, 11:48 a.m.

Not able to select date



Related Blogs
Selenium, Cucumber, JUnit, TestNG dependencies for Selenium project.
Author: neptune | 25th-May-2022 | Views: 2686
#Selenium #Testing #Cucumber #Projects
We guide you how to update the pom.xml file for Selenium Maven project...

How to use wait commands in Selenium WebDriver in Java ?
Author: neptune | 22nd-Feb-2022 | Views: 1612
#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 2022 based on Years of Experience
Author: neptune | 31st-May-2022 | Views: 1144
#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...

Top 10 Selenium Interview Questions with answers (2021).
Author: neptune | 23rd-Feb-2022 | Views: 972
#Selenium
In this article I will cover top 10 Selenium interview questions...

Mostly asked Cucumber interview questions in selenium automation interviews.
Author: neptune | 28th-May-2022 | Views: 850
#Selenium #Testing #Cucumber
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 | Views: 688
#Selenium #Cucumber
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...

Challenges faced in automating Web Applications using Selenium
Author: neptune | 02nd-Oct-2022 | Views: 519
#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...

How to create a Selenium, Cucumber Automation project in Eclipse ?
Author: neptune | 19th-Apr-2022 | Views: 452
#Selenium #Testing #Cucumber
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...

Why we use Robot Class in Automation Testing?
Author: neptune | 23rd-Aug-2022 | Views: 369
#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...

20 TestNG Interview Questions
Author: neptune | 17th-Dec-2022 | Views: 322
#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...

Top 10 Selenium Interview Questions.
Author: neptune | 03rd-Jun-2022 | Views: 276
#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...

View More