Wednesday, November 5, 2014

Sample Selenium IDE Test Script by Recording:


We will use the Mercury Tours website as our web application under test. It is an online flight reservation system that contains all the elements we need for this tutorial. Its URL is http://newtours.demoaut.com/ and this will be our Base URL.

NOTE: The site http://newtours.demoaut.com/ at time is down and not available to work on. We have raised this issue with HP

  1. Create a Script by Recording


Let us now create our first test script in Selenium IDE using the most common method – by recording. Afterwards, we shall execute our script using the playback feature.

Step 1:

  • Launch Firefox and Selenium IDE.

  • Type the value for our Base URL: http://newtours.demoaut.com/.

  • Toggle the Record button on (if it is not yet toggled on by default).


1

 

Step 2:

2

 

Step 3:

  • Right-click on any blank space within the page, like on the Mercury Tours logo on the upper left corner. This will bring up the Selenium IDE context menu. Note: Do not click on any hyperlinked objects or images

  • Select the “Show Available Commands” option.

  • Then, select “assertTitle exact:Welcome: Mercury Tours”. This is a command that makes sure that the page title is correct.


3

Step 4:

  • In the “User Name” text box of Mercury Tours, type an invalid username, “invalidUN”.

  • In the “Password” text box, type an invalid password, “invalidPW”.


4 5

Step 5:

  • Click on the “Sign-In” button. Firefox should take you to this page.


6

Step 6:

  • Toggle the record button off to stop recording. Your script should now look like the one shown below.


7

Step 7:

  • Now that we are done with our test script, we shall save it in a test case. In the File menu, select “Save Test Case”. Alternatively, you can simply press Ctrl+S.


8

Step 8:

  • Choose your desired location, and then name the test case as “Invalid_login”.

  • Click the “Save” button.


9

Step 9:

  • Notice that the file was saved as HTML.


10

Step 10:

  • Go back to Selenium IDE and click the Playback button to execute the whole script. Selenium IDE should be able to replicate everything flawlessly


11

 

15 comments:

  1. As disussed above software testing is one of the important field in detecting the bugs. In Software testing selenium training institute in Chennai we are enabled to identify the errors with advanced level of selenium course and can match the actual results with that of expected results.

    ReplyDelete
  2. Well somehow I got to read lots of articles on your blog. It’s amazing how interesting it is for me to visit you very often.
    python training Course in chennai
    python training in Bangalore
    Python training institute in bangalore

    ReplyDelete
  3. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    Java training in Chennai | Java training in Omr

    Oracle training in Chennai

    Java training in Chennai | Java training in Annanagar

    Java training in Chennai | Java training institute in Chennai | Java course in Chennai

    ReplyDelete
  4. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    Data Science Course in Indira nagar
    Data Science Course in btm layout
    Python course in Kalyan nagar
    Data Science course in Indira nagar
    Data Science Course in Marathahalli
    Data Science Course in BTM Layout

    ReplyDelete
  5. Well researched article and I appreciate this. The blog is subscribed and will see new topics soon.
    Python Online training
    python Training in Chennai
    Python training in Bangalore

    ReplyDelete
  6. Really Getting interest while reading each and every post. Thanks for sharing your valuable time with this Informative contents.For Python Training Visit

    python training in chennai | python training in annanagar | python training in omr | python training in porur | python training in tambaram | python training in velachery

    ReplyDelete
  7. Its such as you learn my mind! You appeаr tо grasp ѕo much approximately this, such as you wrote the book in it or something.
    I think that you could ɗo wіth some percent to pressure the mesѕage home a little bit,
    but instead of that, this iѕ excellent blog. An excellent
    read. I ԝilⅼ defіnitely be back.


    data science training in chennai

    data science training in velachery

    android training in chennai

    android training in velachery

    devops training in chennai

    devops training in velachery

    artificial intelligence training in chennai

    artificial intelligence training in velachery

    ReplyDelete