Hi PLZ explain User Defined Functions in QTP with eample?

Answer Posted / amarendra kothuru

Functions - two types
1)Buitin - Prepared by QTP
2)User Defined - Prepared by programmer/tester

Syntan to creat User defined function in QTP

Function FunctionName(Parameter1, Param2,.....)
Statement1
Statement2
.....
.....
End Function

Example:

Function Bigger(value1, value2)
If value1 > value2 Then
Bigger = value1
Else
Bigger = value2
End If
End Function

Calling the function in the script

Result = Bigger(20,21)
Msgbox Result 'gives 21

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How u will do versioning in QTP?

1453


what you mean by artifact,milestone...

1494


Explain the check points in quicktest professional?

537


How to do the scripting. Are there any inbuilt functions in QTP? What is the difference between them? How to handle script issues?

572


What is the difference between run time object and test object in QTP?

564






How can I import environment from a file on disk?

531


write a script to verify the image path(src property) of the images which are in web pages.

1801


Explain the features of quick test pro(qtp)?

569


Which scripting language used by quicktest professional?

527


Explain the checkpoint in qtp?

590


HI I want to know the detials of QTP certifications such as syllabus, study Materil etc. Can any provide me all these details?? my mail ID is krishnuvk@yahoo.com

1534


Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.

1367


How will internal and external links be validated and updated? how often?

637


What we are looking for is to load properties of object dynamically as for our application the global repository will pretty huge. It will be really helpful to us if something similar to following functions of Winrunner is available in QTP. #Define descriptor auto strDesc; #set property in the descriptor Gui_desc_set_attr(strDesc,?Class?,?Edit?); --- put other properties #Add Edit box to GUI Map Gui_add(? ?,strWindowName,strEditboxName,strDesc);

3491


What is the framework your company is following. What is the reason. Explain why key word driven frame work is chosen.

1627