Coders Packet

IRCTC Website Automation using Selenium webdriver and Python as programming language

By Deepak Kumar Jha

My program basically automates IRCTC ticket booking website. I have used Python as my primary programming language and the main library that I have used in this project is Selenium.

When we first run our program, in the output window we can see, program is asking for IRCTC user id and password.

Login Credentials

Soon after entering the login credentials, program will redirects to the website and automatically click on login button and will enter the credentials provided by you. One thing you have to do every time is to enter all the captcha that will appear during the booking process. 

Login page

After logging in to your account, it will automatically enters the source and destination station as New Delhi and Patna respectively and then will click on search button and reads all the trains that are available during that particular time.

The chrome browser then automatically minimize and train names will be displayed in our output section, asking us to enter our preferred choice for train.

Output window

As we can see below, after entering the choice of train, program will ask for all the details of travelling passenger and whether the passenger wants to insure his/her trip or not.

It will store all these details in variables and whenever needed, will pass to the website automatically. After taking these details from user, program will again redirect to website for further booking process.

passenger details

As per the details entered by user, website will proceed accordingly and automatically selects the train and enter the details of passenger. Address needs to be enter by user in real-time. Finally, it will select the payment option and will redirect to payment page where all the details needed to be entered by user and ticket will be booked successfully.

payment page

Download Complete Code


  • sarabjit singh :

    when i enter captcha and tap on login then it is automatic refresh captcha again. help plz

    contact 8727851142

  • Reply to this comment

  • Rahul :

    Dears sir,

    plase send complete project becuase and more some file is not avilable 


  • Reply to this comment

    Download Packet

    Reviews Report

    Submitted by Deepak Kumar Jha (djha475)

    Download packets of source code on Coders Packet