Give me Example for Generic Functions in QTP
Framework....Anybody please answer me..Thanks in Advance
Answer Posted / vijay chourasiya
Generic Function:
Generic function means the conman functionality in the application.Example
button, Edit box, Combo box and Radio button,Dropdown,Click on link,Login,Logout,Verifypage.
So if you want to create the generic function/Reusable function in the application only change the object not the logic in the function.
For Example:
In framework you have Button so you have to create:
Function buttonclick(obutton)
sobjname = obutton.tostring
sstepname = "Buttonclick"
bexists = obutton.Exist(0)
If bexists Then
smsg = sobjname&" Exists"
reporter.ReportEvent micPass,sstepname,smsg
else
smsg = sobjname&" does not Exists"
reporter.ReportEvent micFail,sstepname,smsg
Exittest
End If
bdisabled = obutton.getroproperty("disabled")
If bdisabled = 0 Then
smsg = sobjname&" is enabled"
reporter.ReportEvent micPass,sstepname,smsg
else
smsg = sobjname&" is disabled"
reporter.ReportEvent micFail,sstepname,smsg
Exittest
End If
smsg = "clicking on "&sobjname
reporter.ReportEvent micPass,sstepname,smsg
obutton.click
End Function
* so here you have to change only (obutton) in the repository or from Util file.
#===================================================================
Project specific functions:
Project specific function is related to the only your project prospective.Example:
login page loading so you will not use wait because you don't know the loading time.
so for this you have to create DynamicLoad Function.and this function also resusable
2)Example:The framework contains input from the XML so you have to create project specific function
3) Example: Suppose you want to manipulate the scripts as per the requirement then you have to create Project specific functions and its control by Driver Script.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How can I change object description or check point values in qtp?
How to run a test using quicktest professional (qtp)?
What the differences are and best practical application of Object Repository?
Which scripting language used by quicktest professional (qtp)?
"What are the common constrains that we need to consider when we prepare testcases for ASP application". Thanks in Advance...
How to use the object spy in quicktest professional 8.0 version?
what are the frame work models of qtp?which frame work you follow in your company?and explain it process?
How to save your test using quicktest professional (qtp)?
how do u plan test automation?
How to connect the remote desktop using QTP 9.2 explain the method or procedure?
how do u manipulating INI, DLL and / or registry files in support of your test environment? actually what do u mean by INI and DLL or registry files. plzzz its urgent do answer
How to add synchronisation points in qtp?
Which advantages helping QTP to hold the position of "Market Leader" for such a long period?
What are the different types of qtp test assets and their extensions?
how to write xml output check point bu useing descriptive programing .means without useing output check point