Thursday, July 24, 2008

Advanced Topics Virtual Object Configuration in QTP

Virtual object configuration is a process of making the QTP tool to Treat an user defined object or a specific area as a specific object.
• Whenever QTP is not recognizing the object, then we Force QTP to recognize that object as a specific object
• Making the QTP to understand a button on the screen.

** Once we created virtual object , it will be available to All Tests except we delete it.

Example :

1. Open the virtual object application ( a window with colorbutton shape)
2. Activate menu item , select Virtual Objects option
3. Select the option New virtual Object
4. Virtual Object wizard will appear, click on Next
5. Select the standard class that nearly match to your object ( say button )
6. Click Next
7. Mark the object on the AUT screen, Height and width will be captured
8.Click Next
9. Select the option for parent of the virtual object
10. Select Next
11. Specify the name (button) and collection name ( Button_collections)
12. Click OK
13. Put the tool under recoding mode
14. Click on the area you selected as button and any area on the screen
15. Stop recording
16. Analyze the results

Virtual Object Manager : Which is a feature provided by QTP used for creating and maintaining the virtual objects.

Advanced Topics Input & Output Parameters in QTP

Input & Output Parameters :-

Input parameter is a concept provided by QTP which is used for Passing some value into the action and getting some value from the action while calling that action.

One has to declare the desired number of input and output parameters at the action that is about to be called in order to pass and get the value.

Function :- is used for Passing and Getting value from a function.

• We need to Return the value to the function name itself.
• Function has a limitation that we can catch or get only one value at time

Example :

Function file
Function add(a,b): function name is add
Total = a + b : adding to values to Total
add = Total : Retuning the result to the function name it self
End function

Main Test file
var = add(10,20) : passing value to function

Action :- is used to pass Two values and return One value

Example :

1. Open the cal application
2. Add the cal application’s object properties to Object Repository
3. Activate menu item Step
4. Select the option Action properties
5. Select Parameters tab
6. Declare the input parameters values by clicking (+) add button
7. Give the name (a) , Type ( number) and some default number
8. Similarly Give the name (b) , Type ( number) and some default number
9. Declare the output parameters by clicking (+) add button
10. Give the name (a) and Type ( number)
11. Click on OK

12. Write the script as below
' setting the input parameter to val1
VbWindow("Form1").VbEdit("val1").Set parameter("a")
' setting the input parameter to val2
VbWindow("Form1").VbEdit("val2").Set parameter("b")
VbWindow("Form1").VbButton("ADD").Click
' getting the value of Result and passing to var1
var1=vbwindow("Form1").VbEdit("res").GetROProperty("text")
' passing that var1 to Output parameter c
parameter("c")=var1

Make this test as re-usable
13. Activate menu item Step
14. Select the option Action properties
15. Select the check box Reusable action
16. Click on OK
17. Save it say (myTest) ( no extension is required)

18. Open the new test
Call that saved re-usable action
19. Activate menu item Insert
20. Select the option Call to Existing action
21. Browse that saved test (myTest)

22. Click on OK
An external action will be added to current test
23. select the action1 from actions list

24. now test pane will have the following code
RunAction "Action1 [myTest]", oneIteration
Replace the above code as below
' oneIteration = one time it will execute
' 100 = passing this value into val1 thru input parameter (a)
' 200 = passing this value into val2 thru input parameter (b)
' r1= getting the output value by outputparameter ( c)
RunAction "Action1 [myTest]", oneIteration,100,200,r1
msgbox r1

25. run the test
26. Analyze the results

Advanced Topics Regular Expression in QTP

1. Regular Expressions :-

During execution some times QTP may not identify the objects due to the regular changes in its properties values. To over come this situation one need to replace the corresponding Constant value in the object repository with a suitable regular expressions.

Example : To send number of orders thru fax

1.Open the flight application
2.Put the tool under recording mode
3.Open an existing order by clicking on open order icon
4.Activate the menu item file
5.Select the option Fax Order
6.Give dummy fax number (say 999-999-9999)
7.Click on Send button
8.Fax will be sent as if its sent.
9.Stop recording Now if you want to send number of orders thru FAX
10.Open the data table
11.Change the 1st column name as ‘order_no’
12.Give the order numbers you want to send fax ( say 8,3,1)

Now change the edit box script where you enter order id in such way that QTP should enter order ids from data table.

' this statment where recorded while trying to open order number 9
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "9"
' update above statement only in the main test script as below
' setting the datatable values into edit field of open order
' order_no is the column name of data table
' 1= global sheet in datatable
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set datatable("order_no",1)

1.Open the object repository
2.Select the Fax order No. in object hierarchy
3.Select the Text property
4.Click on Constant option value button
5.Constant value option window will appear
6.( To search all the files, we use *.* ) in the same way
7.Change the value name with .* extension ( say Fax Order No.*)
8.Select the checkbox Regular Expression
9.Click on OK
10.Click on No button (optional)
11.Click on OK
12.Run the test
13.Analyze the results

Monday, July 14, 2008

QTP 9.2

1. A new feature by name screen recorder is provided which is used for recording the movie of the execution and that can be played back during the result analysis for better understanding

2. One can handle the object repositories dynamically through scripting with the help of an utility object repositories collection

Example:

Repath= “d:\r1.tsr
Repositories collection.remove all( )
Repositories collection.add(repath)
vbwindow("Form1").VbEdit ("val1").set “10”
vbwindow("Form1").VbEdit("val2").Set “20”
vbwindow("Form1").VbButton("ADD").Click

Pos= repositories collection.find(repath)
Repositories collection.remove(pos)

1. Object spy functionality is enhanced in such a weather one can view multiple objects information continuously by keeping the mouse pointer over the object

2. QTP 9.2 is compatible with the following browser

3. Internet explorer 7.0

4. Mozilla fire fox2.0

5. Net space navigation 8.1.0

QTP 9.1

1.A new feature by name navigate and learn is introduced present in multiple pages or windows continuously by navigating

2.A new feature by name object repository comparison tool is introduced which is used for comparing two shared repositories

3.QTP 9.1 is compatible with windows vista operating system and .net frame 2.0
environment

4.The script editor is made user friendly

5.The company has announced that they will provide license for all the add ins also

Thursday, July 3, 2008

QTP 9.0

1.Test menu item is renamed as Automation
2.Settings option is moved from test menu item to file menu item
3.Quality center connection option is moved from tools menu item to file menu item
4.Step menu item is removed and all the options present under it are kept in the edit menu item
5.A new menu item window is introduced used for managing the window
6.A new option by name function definition generator is introduced which is used for creating the functions easily
7.New options are provided for commenting and un commenting the block of statements
8.A new option by name check syntax is introduced under tools menu item used for checking the syntax of script
9.Some of the options related to the resources like object repository, recovery scenario manager are moved from tools menu item to a new menu item resources
10.A new menu item resourced is introduced with some new options like object repository manager and associate repositories
11.Object repository manager is used for creating and managing the shared repositories with out having any connection to the test


Anatomy of QTP 9.0:

QTP 9.0 screen can be divided in to 7 parts

1. Test pane
2. Active screen
3. Data table
4. Debug viewer pane
5. Tool Options
6. Information screen
7. Missing resources screen

6.Information screen:
Information pane is used for viewing the syntax related information during the syntax Check

Main change: One can associate one or more shared repositories to an action a part from its local repository

7.Missing resources:
When the test is being open if at all any associate resources like repositories, library files, recovery files are missing then the complete information related to that will be shown in the missing resource pane

Wednesday, July 2, 2008

Data Base Connection,Oracle connection and SQLServer connection

M.S Access Connection:
Dim con, rs
Set con = createobject("adodb.connection")
Set rs= createobject("adodb,recordset")
con.provider= "microsoft.jet.oledb.4.)0"
con.open "d:\test data.mbd"
rs.open "select * from info", con
Do while not rs.eof
vbwindow("Form1").VbEdit("val1").Set rs.fields("v1")
vbwindow("Form1").VbEdit("val2".set rs.fields("v2")
vbwindow("Form1").VbButton("add").Click
rs.movenext
Loop

Oracle connection:
Con .open “provider =oraoledb.1;server=local host;uid=scott;pwd=tiger;database=testdata;”


SQLServer connection
:
Con.open provider= sqloledb.1; server=local host; uid=sa; pwd=; database= test data;”

Automation Object Model

Automation object model: (AOM)

Automation object model is a concept provided to automate the operations on QTP through scripting

Dim qtapp
Dim qttest
Set qtapp= create object (“quicktest.application”)
Qtapp.launch
Qtapp.visible

Qtapp.open”d:\aom1”, true
Set qttest=qtapp.test
Qttest.run
Qttest.close

Qtapp.open “d:\aom122”, true
Set qttest= qtapp.test

Qttest.run
Attest.close

Qtapp.quit

Tuesday, July 1, 2008

DATA TABLE METHODS In QTP

Data table methods are used for performing the operations on the runtime data table and Input/Out put Parameters

read more | digg story

Monday, June 30, 2008

DATA TABLE METHODS In QTP

Data table methods are used for performing the operations on the runtime data table

1. Add- sheet: It is used for adding the new sheet for the runtime data table
SYNTAX: Data table.add sheet”sheet name”
2.Delete- sheet: It is used for deleting a specified sheet from the run time data table
SYNTAX: Data table.delete sheet”sheet name”
3.Import: It is used for importing the data present in all the sheets in an excel file to the runtime data table
SYNTAX: Data table.import ”path of the excel file”
4. Import Sheet: It is used for importing specified sheet of data from the excel file to the specified sheet in the runtime data table
SYNTAX: Data table. Import sheet “path of the excel file, source sheet id, destination sheet id”

5.Export: It is used for exporting the complete data present in the run time data table to a specified location
SYNTAX: Data table. export “Path of the location with a file name.xls extension

6.Export Sheet: It is used for exporting the data present in a specified sheet in the run time data table to a specified location
SYNTAX: Data table .export sheet “path of the location with a file name.xls extension”, sheet id to be exported.

7.Set currant row: It is used for making the QTP focus on a specified row
SYNTAX: Data table. Set currant row (row number)

8.Set next row: It is used for making the QTP focused on the next of the currently focused row
SYNTAX: Data table. Set next row

9.Set Prev Row: It is used for making the QTP focus on the previous row of the currently focused tow
SYNTAX: Data table. Set prev row

10. Value Method: It is used for getting a value from a specified sheet, specified column and currently focused row.
SYNTAX: Variable= Data Table. Value ( “column name”, sheet id)

11. Get Sheet: It is used for making the QTP to focus on a specified sheet
SYNTAX: Data table. Get sheet (sheet id)

12Get Row Count: It is used for getting the row count of a global sheet
If at all one wants to get the row count of a specified sheet first of all they need to make the QTP to focus on a specified sheet and then get the row count

SYNTAX 1: Variable= Data Table. Get row count
SYNTAX 2: Variable= Data Table. Get sheet (“sheet id”). Get row count


Example:
Data table. Addsheet “ Sri”
Data table.import sheet “e:\Sri\td122.xls,1,3
N=Data table.get sheet( 3).getrowcount
For i= 1 to n
Data table. Set currant row( i )
Vbwindow(“form1”).vbedit(“val1”).set data table(“v1”,3)
Vbwindow(“form1).vbedit(‘val2’).set data table(“v2”,3)
Vbwindow(”form1”).vbbutton(“add”).click
Exp val= data table.value(“ev”,3)
Act val= vbwindow(“form1”).vbedit(“res”).getroproperty(“text”)
If (exp val= act val) then
Data table (“res”,3)= “pass”
Else
Data table (“res”,3)= “fail”
End if
Next
Data table.export sheet “D;\fl_automation\log\file2.xls”,3
Data table.delete ‘Sri”

Input/Out put Parameters:
One ca pass number of values in to the function while calling and a function can return only one value.

Example:

Function add(a,b) Main program
Res= a+b Add(10,20)
Add= res Msg box var
End function

Input/Out put parameters concept is used for passing some values in to the action to return some values once the execution is finish

To do the same one has to declare the desired number of input parameters and out put parameters at the action, which is about to be called

Navigation:
• Activate the menu item test
• Select the option action properties
• Select the parameters tab
• Declare the desired number of input/output parameters
• Using the corresponding add buttons
• Click on OK

Exmaple
vbwindow("Form1").VbEdit ("val1").set parameter ("a")
vbwindow("Form1").VbEdit("val2").Set parameter ("b")
vbwindow("Form1").VbButton("ADD").Click
var= vbwindow("Form1").VbEdit("res").GetROProperty "text"
parameter ("c")= var
vbwindow("Form1").Vbbutton("SUB").Click
var1=vbwindow("Form1").VbEdit("res").GetROProperty "textA"
parameter ("d")=var1
vbwindow("Form1").VbButton("CLEAR").Click

At the calling point one need to specify the input values in a sequence separated by commas and the variable names in a sequence in order to catch the return value

Example: Take the new test

Run action "action1[inout122]", one iteration,20,30,r1,r2
msg box r1
msg box r2

Friday, June 27, 2008

Simple VB script functions used for comparisons and calculation

Simple VB script functions used for comparisons and calculation:-

1. CINT: Used for converting a value in to integer value

2.CSTR: It is used for converting a value in to string

3.CDBL: It is used for converting a value in to Boolean value

4.CBOOL:It is used for converting any value in to Boolean value

5.LTRIM: It is used for trimming the left side spaces

6.RTRIM: It is used for trimming the right side spaces

7.TRIM: It is used for trimming the both side spaces

8.LEFT: It is used for getting the left side sub string
SYNTAX::var=left(string or variable, no of chars)

9.RIGHT: It is used for getting for right side sub string
SYNTAX::var= Right(string or variable, no of chars)

10.MID: It is used for getting the middle sub string
SYNTAX: var=mid (string or variable, starting char no, no of chars)

11.UCASE: It is used for converting a string in to upper case

12.LCASE: It is used for converting a sting in to lower case

13.Round: It is used for rounding any decimal value to nearest highest integer

Seventh Case study

Develop the script for selecting the

1)Product id,
2)Entering quantity,
3)clicking on Cal Button
and checking weather it is working fine or not

By writing below code and you will get the above options

Vbwindow(“product”).vbcombobox(“pid”).select “007”
Q=5
R=vbwindow(“product”).vbedit(“prate”).getroproperty “Text”
EV=r*q
Vbwindow(“product”).vbedit(“quantity”.set q
Vbwindow(“product”).vb button(“cal”).click
AV=vbwindow(“product”).vbedit(“amount”).getroproperty “text”
If (EV=AV) then
Reporter.reportevent, 0,”my report”,”cal button is working”
Else
Reporter.report event,3,”my report”,”cal button is not working”
End if

Sixth Case Study

Develop the script for clicking on a ok button if it is existing and enabled otherwise the corresponding message should be reported to the result window

By writing the below code you will get the above options.

Var= vbwindow.(‘form1”).vb button(“ok’).exixts
If( var=true) then
Var2= vbwindow.(“form1”).vbbutton(“ok”).getroproperty(”enabled”)
If(var2=true) then
Vbwindow.(“form1”).vbbutton(“ok”).click
Else
Reporter.report edit,3,”my report”,”Ok button is visible”
End if
Else
Reporter.report edit,3,”my report”,”form dowsnot exists”
End if

Descriptive Programming

Descriptive Programming: -
If at all the objects description is specified in the program itself then that type of programming is known as descriptive programming

Dialog(“text:=login”,”width:=320”).windedit(“attached test:= Agent Name:”)
Dialog(“text:=login”).winedit(“attachedtext:=password:”).setsecure xxxxxx
Dialog (“text:=login”).winbutton(“text:=ok”).click
Window(“text:=flight reservation’).close

GetRoProperty:
It is used for getting the currant value of the runtime objects property
Syntax: Variable=Object hierarchy.getroproperty(“property name”)

Fifth Case Study

Develop the script for:

1)Entering train number,
2)Train name,
3)Date of journey,
4)selecting Starting point,
5)selecting Destination point,
6)selecting Berth,
7)selecting Class

by writing below code you will get the above option:

Vbwindow(“res”).vbedit(”trainno”).set”2085”
Vbwindow(“res”).vbedit(”Trainname”).set”Godavari”
Vbwindow(“res”).vbedit(”Date of journey”).set”15-aug-08”
Vbwindow(“res”).vbcombobox(“from”).select “Sec”
Vbwindow(“res”).vbcombobox(“To”).select”Tpg”
Vbwindow(“res”).vbradiobutton(“LB”).set
Vbwindow(“res”).vbradiobutton(“sleeper”).set
Vbwindow(“res”).vbcheckbox(“breakfast”).set on
Vbwindow(“res”).vbcheckbox(“dinner”).set on
Vbwindow(“res”).vbbutton(“next”).click

Activate Method:
It is used for activating a window or a dialog.
Syntax: Object hierarchy. Activate

Close Method:
It is used for closing the window or a browser
Syntax: Object hierarchy. Close

Set Secure:
Set secure method is used for setting an encrypted data in to an edit box

Type Method:
Type method is used for performing any kind of key board related operation
Syntax: Object hierarchy. Type key value
Example:
Dialog (“login”). Winedit(“agent name”).type mic tab

Fourth Case Study

Develop the script for entering the

1)Name
2)Age
3)Country,
4)and selecting the Gender
5)selecting the check box photo profiles only and clicking on search button

By writing the below code you will get the code above options:

Vbwindow(“matrimony”).vbedit(“name”).set”sri balaji”
Vbwindow(“matrimony”).vbedit(“age”).set”25”
Vbwindow(“matrimony”).vbedit(“country”.set “India”
Vbwindow(“matrimony”).vbradiobutton(“female”).set
Vbwindow(“matrimony”).vbcheckbox(“photo profile only”).set “on”
Vbwindow(“matrimony”).vbbutton(“search”).click

Third Case Study

Develop the script for deselecting the

1)Testing tools check box
2)selecting the QTP and
3)live project check boxes
and clicking on next button

by writing below code you will get the above options:

Vbwindow(“mindq”).vbcheckbox(“testing tools”).set “off”
Vbwindow(“mindq”).vbcheckbox(“QTP”).set”ON”
Vbwindow(“mindq”).vbcheckbox(“liveprojects”).set”on”
Vbwindow(“mindq”).vbbutton(“next”).click

Second Case study

Develop the script of selecting:

1)Testing tools
2)sql server
3)live projects
4)check boxes
and clicking on next button.. by writing the below code and get the above options:
Vbwindow(“mindq”).vbcheckbox(‘testingtools”).set”on”
Vbwindow(“mindq”).vbcheckbox(“sqlserver”).set”on”
Vbwindow(“mindq’).vbcheckbox(“liveproject”).set “on”
Vbwindow(“mindq”).vbbutton(“next”)click

Case study-1

Develop the script:

1)Customer id
2)custname
3)currant age
4)cust phone number

and clicking on submit button by writing the below code:

Vbwindow(“cust”).vbedit(“cust”).set.”Custid”
Vbwindow(“cust”).vbedit(“custname”).set”name”
Vbwindow(“cust”).vbedit(“custage”).set”age”
Vbwindow(“cust”).vbedit(“custphno”).set”phoneno”
Vbwindow(“cust”).vbutton(“submit”.click

Second Method- Exist method -Click and Double Click Methods

It is used for checking the objects existence if the object is existing then it will return a value True, and make the QTP to continue the execution, If at all the object is not existing it will make the tool to wait till object exists. Once the object exists it will return true and make the QTP to continue the execution. If at all the object is not existing up to the maximum time then it will return false and make the QTP to continue the execution


Syntax: variable=object hierarchy.exists(time in seconds)

Example: Var= window(“flight reservation”).exists(12)

Wait property:

Wait property is used for making the tool to wait based on the object properties value

Syntax: object hierarchy.wait property “property name”, property value, extra time in mille seconds

Wait: it is used for making the tool to wait till the specified time is elapsed.

Syntax: Wait” Time in seconds”

Simple and regularly used methods: -

The first method among those is click method.

1. Click method: -
Click method is used for clicking on specified object

Syntax: Object hierarchy.click(x,y,[button] )

2. Double click: -
It is used for double clicking on a specified object

Syntax: Object hirerarchy.dblclick(x,y, [button])

3.Set Method: - Set method is used for setting a value in to an edit box or selecting or deselecting acheck box or selecting a radio button

Syntax: Object hirerearchy.set”value”
Object hierarchy of check box.set “on/off”
Object hierarchy of radiobutton.set

First Method – Capture Bitmap

It is used for capturing a snap shot of an object or an window during executin and stores it in the desired location

Syntax: Object hierarchy.capturebitmap “Path of the location with a file name.bmpextension”
Example:
Window(“flight Reservation”).dailog(“openorder”).winbutton(“ok”).capturebitmap”D:\fl_automation\b1.bmp”

Thursday, June 26, 2008

Keyword Driven FrameWork in QTP

Create the folder structure as follows:

• Create the required test data file and save them in the corresponding folders
• Create the required shared repository files and save them in the corresponding folder
• Create the required library files and save them in the corresponding folder
• Create the required environment files and save them in the corresponding folder
• Create the required recovery files and save them in the corresponding folder
• Open the main test and associate all the required files to each
• Develop the script in such a weather it executes based on the key words specified
in the data table

Example:

Var= data table (“keys”,1)
Select case var
Case “L1”
Login( )
Ins ord( )
Logout( )

Case”L2”
Openord( )
Logout( )
Case “L3”
Login( )
Logout( )
End select

• Specify the desired key words under the corresponding column in the data table and save the test in the corresponding folder

Note: When ever required open the test and execute it and analyze the result

Tuesday, June 24, 2008

Modular Framework-QTP

Modular Framework:

• Develop the individual components for each and every task
• Make them as reusable components
• Prepare the required drivers based on the end to end scenarios
• Execute the drivers
• Analyze the result

Actions

ACTIONS: Action is a set of script statements used for performing a specific task

Types of Actions:

There are three types of actions
1.Normal actions
2.Re-usable actions
3.External actions

Note: External actions are not editable .The re-usable actions called in another test are known as external actions

Operations On Actions:

Navigation for inserting a new action:

• Activate the menu item insert
• Select the option call to new action
• Rename the desired action
• Select the one of the following options
o At the end of the test
o After the currant step
• Click on ok

Navigation for splitting an action in to two actions:

• Save the action
• Keep the cursor on the first statement of the second path
• Activate the menu item step
• Select the option split action
• Select one of the following options
o Independent of each other
o Nested
• Specify the desired action name
• Click on ok

Navigation for making an action as reusable action:

• Select the desired action
• Activate the menu item step
• Select the option action properties
• Select the check box reusable action
• Click on ok

Navigation for renaming the action:

• Activate the menu item step
• Select the option action properties
• Specify the desired name
• Click on ok

Navigation for calling on existing action:

• Activate the menu item insert
• Select the option call to existing action
• Browse the desired test
• Select the desired action
• Select one of the following options
o At the end of the test
o After the currant step
Click on ok

Monday, June 23, 2008

Framework-QTP

Framework:
Framework is a generic work (outline work) or a set of guidelines designed by an expert to perform a task in an effective, efficient and optimized way

Types of frame works: - (Mainly)

1. Linear frame work
2. Modular frame work
3. Key-word driven frame work
4. Hybrid frame work
5. Data frame work

1.Linear Framework

• Generate the basic test
• Enhance the test
• Debug the test
• Execute the test
• Analyze the test

Sunday, June 15, 2008

Virtual object configuration-QTP

Virtual object configuration:

Virtual object configuration is a process of making the QTP t treat a specified area or an user defined object as a specific object

Navigation:
• Activate the menu item tools
• Go to virtual objects
• Select the option new virtual object
• Click on next
• Specify the desired class(type) of the object
• Click on next
• Mark the area in the application with the help of mark object button
• Click on next
• Select one of the following options
. Entire parent hierarchy
. Parent only
• Click on next
• Specify the desired object name
• Specify the desired collection name
• Click on finish

Virtual object manager:

Virtual object manager is a feature provided by QTP which is used for creating and managing the virtual objects

Once a virtual object is created it will be available to all the tests unless until we delete it.

Thursday, June 12, 2008

Environment Variables-QTP

Environment Variables

The variables that may be varied in different environments and need to be used in the multiple scripts, should not be directly used in the scripts. They need to be declare separately in an environment file that file need to be associated to the test and then the variables in that file need to be used in those test so that when ever the values need to be updated in different environments one can update them very easily in the environment

So all the tests using those variables will be automatically updated such kind of variables separately declared in the environment file are known as environment variables

There are two types of environment variables

1.Built in variables
2.User defined variables

1.Built in variables:

These variables will be by default available with all the tests so that on can directly use them in any test with the following syntax

SYNTAX: environment.value(“built invariable name”)

Example: var = environment.value(“05”)
Msg box var

2.User defined variables:

These variables need to e declared by us according tour need and need to be stored in a separate environment file. Whenever required one need to associate these files to the currant test and use those variables

Navigation for creating an environment file with environment variables:

• Activate the menu item test
• Select the option settings
• Select the environment tab
• Select the variable type as user defined
• Click on new
• Specify the variable name and the value
• Click on ok
• Click on export
• Browse the desired location
• Specify the desired file name with .XML extension
• Click on save

Wednesday, June 11, 2008

Recovery Scenarios-QTP

Recovery Scenarios:

During the execution QTP may face some problematic situation where in it needs to recover by itself and continue the execution. To do the same a test engineer would have defined a solution well in advance and made it available to the currant test before starting the execution.
QTP may face four types of problematic situations

1.Problems related to pop-up window
2.Problems related to object state
3.Problems related to test execution
4.Problems related to application crash

To define the solution for the above problems QTP has provided four trigger events
1.Pop up window
2.Object state
3.Test run error
4.Application crash

Navigation for object test:

• Activate the menu item tools
• Select the option recovery scenario manager
• Click on new scenario button
• Click on next
• Select the trigger event as object state
• Click on next
• Click on next
• Click on the hand icon
• Click on the desired object in the AUT
• Click on ok
• Click on next
• Specify the desired properties with the help of add/remove button
• Click on next
• Once again click on next
• Select the recovery operation as function call
• Click on next
• Browse the desired library file
• Select the option define new function
• Specify the desired function name
• Write the body of the function
• Click on next
• Deselect the check box add another recovery operation
• Click on next
• Specify the desired scenario name
• Click on next
• Select the desired check boxes
. Add scenario to the currant test
. Ass scenario to default test settings
• Click on finish
• Click on save
• Browse the desired location and save the file by specifying a file name with . QRS extension
• Click on close

Tuesday, June 10, 2008

Descriptive Programming for Orkut Login-QTP

Descriptive Programming for Orkut Login



Systemutil.Run"www.orkut.com"
Set a=browser("name:=orkut.*").page("title:=orkut.*")
a.webedit("name:=Email").set"abc"
a.webedit("name:=Passwd").set"123"
a.webbutton("name:=Sign in").Click
a.Link("name:=Logout").Click

Friday, June 6, 2008

Regular Expressions-QTP

Regular Expressions:

When ever the QTP is unable to identify the objects due to the regular changes in the objects properties values dynamically during the execution then to overcome this problem one need to replace the corresponding property value in the object repository with a suitable regular expression

Navigation:

Open the object repository
Select the desired object in the object hierarchy
Select the desired property in the properties list
Click on the constant value options button
Replace the constant value with suitable regular expression
Select the check box regular expression
Click on ok
Click on ok

Thursday, June 5, 2008

Debug viewer Pane-QTP

Debug viewer Pane

Debug viewer pane is used for viewing, modifying or setting the currant value of the variables or expressions during the execution break with the help of three tabs by name

1) watch expressions
2) Variables
3) Command

Dim a
A= 10
B= 20
Msg box a
Msg box b
Msg box a

Tuesday, June 3, 2008

Learning Software Testing Course

1) Why did you choose this course?

Answer:

(a) Scope of getting a Job is very high.

(b) No need to depend upon any technologies.

(c) Testing remains for ever.

(d) I want to be consistence through out my life.

2) Why explicitily the Testing Engineer recruited by the software company ?

Answer:

(a) A person cannot accomplish two task at a time efficiently.

(b) Sentimentle attachment.

3) Who can do this course ?

Answer: Any graduate can do this course.

4) What i require to get a job ?

Answer:

(a) Stuff

(b) Communication

(c) Confidence

(d) Dynamism

Monday, June 2, 2008

Break Points-QTP

Break Point:

Break point is the feature provided by QTP, which is used for breaking the execution temporarily

Navigation:

• Activate the menu item debug
• Select the desired option

Example
Function my func( )
Msg box “Hai”
Msg box “hellow”
Msg box “How r u”
End function

My func
Msg box “bye”
My func
Msg box”see u”
My func
Msg “welcome”

Monday, May 26, 2008

Why Software has bugs?

Software have bugs because of;Mis-interpretation of requirements or no communication, software complexity,programming errors,changing requirements,time pressure,egos of people,poor documented code,and software development tools used.

What is SDLC?

Initial :

Meeting between business Analyst and Client.
Project initiation note(PIN) is prepared by project manager and submitted for approval to C.E.O
Budget Issues (business issues are discussed)
The output of initial state is BRS

BRS :

Rough Effort Estimation(Manpower, Schedule, Cost)
Overview of the project.
Customer requirements. (Functional)
Customer Expectations. (Performance, Security, Usability)

Requirements analysis gathering:

All the customer requirements and expectations are gathered and analyzed in this phase.
All the customer requirements are transformed to system requirements.
Effort Estimation. Business model is build. Technology is decided.
One copy of SRS goes to designing and another to testing.

Designing:

HLD: It consists of overall architecture of the application from root module to leaf module.
LLD: It consists of architecture and business flow of internal working of sub modules. DFD’s, Algorithms, Flowcharts, E-R diagrams, Network diagrams, and pictorial representation represent these. Output of Design face is called technical design document or functional design document or pseudo code.

Coding:

In this phase pseudo code is converted to machine-readable format using appropriate technology. The output this phase is .exe module.

Testing:

This exe module is tested with the test cases, if any bugs are found they are reported and this process is continued till the application is reasonably bug free.

Maintenance:

In this phase the application goes into production.

Wednesday, May 14, 2008

Result Analysis-QTP

In this phase one will analyze the Results.

Executing the Test-QTP

In this phase one will execute the Test.

Step Commands-QTP

1) Step Into

It is used for executing a single step. If it is normal statement
If that statement is function or action call statement then it will step into that function or action and breaks it’s execution.

2) Step Out

It is used for stepping out of a function or action by executing all the remaining statements from the position of the pointer.

3) Step Over

It is used for executing a single step if it is normal statement.
If the statement is function call or action call it will execute all the statement inside the function or action once and stops it’s execution at the next statement.

4) Break point

It is a feature provided by Q.T.P used for breaking the execution temporarily.

Ex:
Function Myfun()
Msgbox “ hai”
Msgbox “hellow”
Msgbox “h r u”
End statement
Myfun()
Myfun()
Msgbox “bye“
Myfun()
Msgbox “See U”

Debug Viewer Pan

It is an area provided by Q.T.P which is used for viewing, modifying or setting the current values of the variables or expressions during the execution break with the

help of 3 tabs by name.

1. Watch expression
2. Variables
3. Commands

Ex:

Dim a
A=10
B=20
Msgbox a
Msgbox a
Msgbox a

Debugging the Test-QTP

Debugging:

It is a process of executing the script or a program in a user desired fashion with same temperare breaks in order to identify the errors.

To do the same Q.T.P has provided 3 step commands and a break point feature.

Reporter utility object-QTP

It is used for reporting and user defined messages to the result window in order to understand the result better.

Syntax:

Reporter. Report event status, “Report name”, “message”.

Ex: Reporter. Report event 2 / micdone, “Myrep”, “Add oper is successful”.

One can replace the status in following numbers
0 – Pass
1 – Fail
2 – Done
3 – Warning.

Inserting Programmatic Statements-QTP

Vb script is a combination of 5 types of programmatic statements.

1. Normal statements / Objects
2. Conditional statements.
3. Looping
4. Comments
5. Utilities Statements.

Measuring Transactions-QTP

It is a concept provided by Q.T.P, which is used for calculating the time taken by an application to perform a specific task or the execution time of a block of script statements.

To do the same Q.T.P has provided 2 options.

1. Start Transactions.
2. End Transactions.

Navigation through inserts Transaction points.

Keep the cursor in the desired location.
Activate the menu item insert.
Select the option start Transactions
Specify the Transaction name.
Select one of the following options
Before current step.
After current step.
Click on Ok.

In order to avoid the above navigation one can insert the following statements directly into the script

Services. Start transaction “ Transaction Name”
-----------------------------------------------------------
-----------------------------------------------------------
-----------------------------------------------------------
Services. End transaction “Transaction Name”.

Output Value-QTP

It is a feature provided by Q.T.P, which is used, for capturing a value from an application or from a database or from a XML file and stored it under a specified column in the run time data table during execution.

To do the same Q.T.P as provided 5 types of output values.
1. Standard output value.
2. Text output value.
3. Text area output value.
4. Database output value.
5. XML output value.

Operational over view of output values.

Output value feature works in 2 phases

1. Pre-Execution phase.
2. While – Execution phase.

1).Pre-Execution phase:
1. Captures the field name from where the value is to be captured.
2. Generates the corresponding script statement.

2) While execution phase:
1.Captures the actual value form the field.
2. Stores it under a specified column in the run time data table.