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
Monday, June 30, 2008
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
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
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
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”)
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
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
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
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
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
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
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”
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
• 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
• 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
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.
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
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
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
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
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
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
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”
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”
Subscribe to:
Posts (Atom)




