Saturday, April 20, 2013

How to book IRCTC tatkal tickets using Selenium IDE ? - Part 2

        Please refer to first part at How to book IRCTC tatkal tickets using Selenium IDE? before reading this article to understand the context.

This part discusses about the payment options that are recorded below to play back while paying online with Credit Cards. But, be careful about the credit card information. This should be kept very confidential and never be shared with anyone. This is not recommended if you share your system with others.

I gave examples of HDFC and AXIS (Visa and Master cards) below. remember that after filling submitting the passenger information, you will land in a confirmation page where you have click on a button labelled something like "Make Payment" and then you will be presented with payment options.

Choose Credit cards and run the below test cases as per your card provider.


 HDFC Credit Card (Visa and Master cards)



Source


--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://www.irctc.co.in/" />
<title>CCHDFCPayemnt</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">CCHDFCPayemnt</td></tr>
</thead><tbody>
<tr>
    <td>type</td>
    <td>name=cardNo1</td>
    <td>4543</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cardNo2</td>
    <td>5555</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cardNo3</td>
    <td>4332</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cardNo4</td>
    <td>6323</td>
</tr>
<tr>
    <td>select</td>
    <td>name=cardExpMonth</td>
    <td>label=03</td>
</tr>
<tr>
    <td>select</td>
    <td>name=cardExpYear</td>
    <td>label=2011</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cvvNumber</td>
    <td>111</td>
</tr>
<tr>
    <td>type</td>
    <td>name=fname</td>
    <td>McKiran</td>
</tr>
<tr>
    <td>select</td>
    <td>name=cardExpMonth</td>
    <td>label=01</td>
</tr>
<tr>
    <td>click</td>
    <td>css=input.buttonSubmit</td>
    <td></td>
</tr>
</tbody></table>
</body>
</html>

--------------------------------------------



 AXIS Credit Card (Visa and Master cards)







Source

--------------------------------------------
 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://www.irctc.co.in/" />
<title>CCAxisPayemnt</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">CCAxisPayemnt</td></tr>
</thead><tbody>
<tr>
    <td>select</td>
    <td>name=cardType</td>
    <td>label=MasterCard</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cardNo1</td>
    <td>1111</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cardNo2</td>
    <td>4444</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cardNo3</td>
    <td>4444</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cardNo4</td>
    <td>4444</td>
</tr>
<tr>
    <td>select</td>
    <td>name=cardExpMonth</td>
    <td>label=02</td>
</tr>
<tr>
    <td>select</td>
    <td>name=cardExpYear</td>
    <td>label=2014</td>
</tr>
<tr>
    <td>type</td>
    <td>name=cvvNumber</td>
    <td>111</td>
</tr>
<tr>
    <td>click</td>
    <td>css=input.buttonSubmit</td>
    <td></td>
</tr>
</tbody></table>
</body>
</html>

--------------------------------------------

Similarly, you can record other payment options and fill them prior to going online and this saves your time while booking tatkal tickets.

2 comments:

  1. Hi Chandra, thanks for useful information...
    can u pls send me the script for all the steps involved in booking?

    I am getting errors on the irctc site in the recent days.

    my email id is rajesh.vali@gmail.com

    Thanks in advance.

    ReplyDelete
    Replies
    1. Hi Rajesh,
      The error you see mainly because of the new IRCTC view, I guess.

      Please go through all my irctc articles one by on first at http://www.seleniumhq.in/search/label/IRCTC%20-%20Train%20Search
      and try to explore and implement your own code for the new view/version.

      I will soon try to come up with the solutions for newer look of the irctc site, but not immediately!

      Delete