Give me Example for Generic Functions in QTP
Framework....Anybody please answer me..Thanks in Advance

Answers were Sorted based on User's Feedback



Give me Example for Generic Functions in QTP Framework....Anybody please answer me..Thanks in Adva..

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

Give me Example for Generic Functions in QTP Framework....Anybody please answer me..Thanks in Adva..

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

Give me Example for Generic Functions in QTP Framework....Anybody please answer me..Thanks in Adva..

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

Post New Answer

More QTP Interview Questions

When to use descriptive programming?

0 Answers  


There is a name "AJAY" how do u count no.of. "A" in that name ?

4 Answers  


How can i open 5 multiple browser at once through QTP VB script and i want to login with 5 different credentials i already tried with this code but its entering credentials only for first browser and am using datatable to parameterize

2 Answers  


In a QTP project lets say there are 100+ function library and incorrectly we have duplicate some function in multiple libraries. How to find those duplicate functions and remove them?

1 Answers  


how many types of actions r there? what r they? explain? pls give any one answer?

3 Answers   IBM,


What are the environment variables?

3 Answers  


Explain features of the latest version of qtp/ uft 12.1?

0 Answers  


How to make Shared object repository in qtp 9.1 and 9.2?

2 Answers  


How does QTP identifies the object in the application Mainly objectives are three type's OF PROPERTIES namely

3 Answers  


I encountered with very strange problem in qtp while writing the script i written the code window"regexpwndclass:=XLMAIN").window"regexpwndtitle:=Open" ).Exit this code was working fine for about 10-15 times i executed the script but after some time qtp started giving the error with the same code the error is "Object doesnt support this method or function window(...).window(..)" then i modified the code with only window"regexpwndtitle:=Open").Exit in place of window"regexpwndclass:=XLMAIN").window"regexpwndtitle:=Open" ).Exit now again its working fine i cannot understand what thing is creating the problem if same code executed successfully in starting for about 10 times then why it is giving the error now can anyone give the reason .

0 Answers  


in a web page hoe to check the dynamic links that rechabging with out using regular expressions

0 Answers   CTS,


Is it possible to split an action? How?

0 Answers  


Categories