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 do you know the location Id of an object if you know its index id?
Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.
How to analyzing the checpoint results?
if anyone has idea of the interview procedure in covansys, plz send me a mail?
What are the different types of recording modes?
what is test scheduleling?
How many tabs are available in debug viewer pane?
How to release all resources file from the QTP?
why you have standardized functions? plzzz guys with real time exp. do answer
How to create Reusable and Multiple Actions?
please post the interview questions for QA position in FACTSET
How to find operating system information using the qtp script?
How is recording done when a application is over lapping the QTP application it gives a message object not recorded
Give me detailed theritical explanation about keyword driven, hybrid framework, environment variables, hybrid frame work
Hi, my requirement is to make a query in SQL using QTP. And i have to get the results of that query and i have to use those results for future testing. I created a driver but i dont know the code for using this Driver. please help me by providing the solution for y requorement