Search This Blog

Wednesday, November 24, 2010

QTP Automation Process 

Any automation process is similar in nature & independent on any tool used, topic which we are discussing here is based ion QTP but you can follow it with any Functional Tool. Automation process is nothing but a set of instructions or guidelines which needs to be followed strictly & sometime moderately :) as per our requirements. As we start automation we should take care of area which needs to be automated. Very well discussed with many internet forums we al know that automation of entire application is neither feasible nor advised though its possible to automate the entire application but normally stakeholders focus on area to automate which is more to regress.

There are 6 basic guidelines in automation process.
1. Planning
2. Prepare to Test
3. Record your script.
4. Enhancement to Script
5. Running & Debugging Test
6. Analyzing your Run Result

Lets explore it more in details:

1. Planning: Planning the most important part in any activity. When you think about automation of the application you start planning for this. First you have to analyze your application to determine for your testing needs. This includes understanding of platform & environment. Based on this you will load QTP Add-ins, for example if your application is developed in .net environment & some objects used are of Java then you should be having .net as well as Java Add-ins loaded in QTP. Now you have to look for the business process which you are going to test, you have to break these Business Process to modular & smaller units which will be used as actions. With help of these actions you will simulate user activity which he will perform in your application. Modular actions will help to maintain your automation.

2. Prepare to Test: Now you have to determine what resources you required to test your application. As per your requirement you will decide for Shared/ Per Action Repository. You will create shared repository & Function Libraries, if you have some test specific preferences you will set it, set your Run & Record Settings, Create recovery scenario (this you can do later as well if you find any scenario). Set folder options & associate your function libraries with your test & lastly associate your shared repository to actions.

3. Record your script : As you navigate or simulate user actions with your application QTP graphically displays each step you perform as a row in the keyword view, these steps are also displayed in expert view as VBScript steps.Complete your action & QTP displays each object you worked in Keyword View or you can drag/drop objects to create some user generated steps.

4. Enhancement to Script: Till now your basic structure is ready but you have do nothing as you have not test anything. If you run your script you will find that nothing has Passed/Fail. We just navigate to this application & logout. Ok Lets test something. For verifying or testing we enhance our script by inserting Checkpoint, Regular Expressions,OutPut Value, Parameterization.(We will discuss it later)

5. Running & Debugging Test : OK….you are grooming better :)…..now you have everything ready.You have done all Enhancement now its time to run your test.As you run your script, QTP connects to your application & simulate all steps as you created in actions. It checks for all strings, tables, objects etc which you deal while recording & verify for enhancement you made using checkpoints, Output alue, Parametrization etc. You can control you run session & debug your test if you want during run session apart from breakpoint you can use Step Into, Step Over,Step Out Commands to run your test step by step. You can run your test to update your script. 2 Modes are provided for this purpose a) Maintenance Run Mode : Used to update script if Application/Object has changed. b) Update Mode: Used to update changed object prosperities.

6. Analyzing your Run Result: Now you got some test which fail & some test which are pass. You get summary/detailed report of your test Run & cause if you capture Still Images/Movie for you test. You can log defects as per your test.

Friday, November 12, 2010

Send unlimited Free SMS with help of QTP

Sending sms on occasions like diwali,new year etc is very hectic & time taking process & consume lot of money too.It takes around 2-3 hours of my time & lot of money as most of the service providers raise there prices on these ocassions.But this time I save my money as well as time with help of qtp…how ???????????????

Answer is very simple there are lots of websites available which are providing free sms service you just have to create you login & register your mobile number with them & they offer you unlimited SMS’s.

I’ve used Indyarocks.com for this purpose.I have created a login & registered my mobile number with them.Then I record the message sending process using QTP in 3 steps

 Login

 Send Message

 Logout

1. Browser("Indyarocks - India's No.1").Page("Indyarocks - India's No.1").WebEdit("username").Set "abc”

2. Browser("Indyarocks - India's No.1").Page("Indyarocks - India's No.1").WebEdit("pass").SetSecure "fdkff34tl3k4l345tk5makhgsdf434j4ffddsfsaq"

3. Browser("Indyarocks - India's No.1").Page("Indyarocks - India's No.1").Image("but_home_login_rock").Click

4. Browser("Indyarocks - India's No.1").Page("My Life at Indyarocks").Link("Free SMS").Click

5. Browser("Indyarocks - India's No.1").Page("Free SMS to India, Free").WebEdit("frno").Set DataTable("Number", dtGlobalSheet)-------- (Parametrize number.)

6. Browser("Indyarocks - India's No.1").Page("Free SMS to India, Free").WebEdit("message3").Set "Happy Diwali" & vbNewLine & "XYZ"

7. Browser("Free SMS
Send free SMS").Page("Free SMS
Send free SMS").Image("Send Free SMS").Click

8. Browser("Indyarocks - India's No.1").Page("Free SMS to India, Free_2").Link("Logout").Click

9. Browser("Indyarocks - India's No.1").Page("Indyarocks - Login").Sync

Steps:
1. Create a user with http://www.indyarocks.com & register your mobile phone with this site.
2. Open QTP>Automation>Record&Run Settings
3. Set http://www.indyarocks.com as application.
4. Start recording.
5. Login to application
6. Goto Link “SMS” & select “Free SMS”
7. Goto Tab Free SMS to Non-Members & Enter Mobile number & Text message.
8. Click Send.
9. Logout

I have written this script using local object repository if you want to use DP you can use that.
After finishing this test goto keyword view & select where you have entered mobile number to send sms & parameterize it with datatable.

Now copy all your contact numbers to data table column.

Run this script sit back ,relax & enjoy. This will run for as many iterations as you defined numbers in your data table.…..now just enjoy n let qtp do messaging for you.

Happy messaging.

For any other help mail me…..

~Neeraj Bhatnagar

neeraj.engg@gmail.com