Give me Example for Generic Functions in QTP
Framework....Anybody please answer me..Thanks in Advance
Answers were Sorted based on User's Feedback
Answer / vijay reddy
In framework we have two types of library functions
1)Generic functions
2)Project specific functions
Generic functions are generic to any other application
For Example if we create generic functions for one
webapplication , the same generic functions can use for
another applications in automations
Is This Answer Correct ? | 19 Yes | 0 No |
Answer / ram
Qtp supports relative path framework.Relative path framework
can help you in creating a generic functions and calling
them through the driver script.
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / 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 |
whenever U using QTP,Test Director, Why we using separate Bug tracking tool?
In a WebTable 2nd row,3rd column contains one link and that link name is changing dynamically. How you will click the link?
write a function to read the items from Combobox of Flight Reservation application and save in excel.
How you can make an action as re-usable action?
Hi all. Could anyone tell me the difference between an Action and a Function in QTP. Thanks in advance and Merry Christmas.
can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?
What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?
How to data driven test for Win objects in QTP ?
what testplan contents and what test strategy contents,what is the diff b/w them
Can Any One Write How to Write the Script for Child Objects
what is Supplemental Objects ?
I've some problem in Descriptive programming plz help me. I've written in a click event code in Functional library when I run this flight reservation program It is not run. How to I write multiple click event in functional library. My program is this. I have associate an action with functional library. Public Function ClickButton(byval ApplicationName, byval WindowName, byval ObjectName, byref Comments) If Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Exist Then Dialog("text:=" &WindowName).Activate Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Click Elseif Window("text:="&ApplicationName).WinButton("text:=" &ObjectName).Exist Then Window("text:=" &ApplicationName).Activate Window("text:=" &ApplicationName).WinButton("text:=" &ObjectName).Click End if End Function