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

What is the limitation to XML Checkpoints?

1 Answers  


What is the extension of 'Log file' in QTP

3 Answers  


if we can find the status of script in qtp that either it's pass or fail then why we need to put this status on different excel file or log file in hybrid framework .please let me know asap thanks

1 Answers   iCreate,


Hello everyone, I am trying to parametrize a script. Its clear to me that, we use data table to enter various text data. but if I want to change the radiobutton (e.g. if for first iteration I selected radio button 'A' and for second iteration I want to use 'B' radio button for second iteration) then how can I make it happen. I have tried to define the question but still if not clear plz tell me. Thanks everyone

1 Answers  


How to use checkpoints in qtp ?

0 Answers  






How do we connect QC by using QTP?

2 Answers   Infosys,


when do we write a script in qtp?(plz give me more then 2 reasons)

1 Answers  


Can we call qtp test from another test using scripting. Suppose there are 4 tests and I want to call these tests in a main script. Is this possible in qtp?

0 Answers  


if there is a web table of having row and colmns.a button is placed at 2nd row's 3rd column which is worked for both edit and delete..how to write script for the button to test both operation on the web table using desriptive programing.. plz help me on script wheather using getroproperty Q2)what is the command for taking valiue from a web table in qtp

6 Answers   Logica CMG,


How you create new action in qtp?

0 Answers  


I have many listboxes in my application. I have to check whether the contents inside the listboxes are in sorted order or not..can anyone please send the code as early as possible

0 Answers  


Is there is any method how to connect remote desk throw QTP if yes please answer with a example?

3 Answers   HP,


Categories