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

What are the types of object repository in qtp?

557


what difference between runtime object and text object and what property they have. whether they have same properties or different properties.

1699


What are the key points to create a framework in QTP for oracle forms?

1797


How to create a standard checkpoint ?

550


How to check feasibility of the appliction?in automation testing?

1465






How to integrate the qualitycenter with qtp

1763


What are the challenges u faced in testing with crm domain? How u overcome with?

1478


Define Environment Variable in UFT and its uses?

601


What is contained in the object repository?

604


How can I check if a environment variable exist or not?

532


hai, i completed my b.tech in 2010 with 62.3%. i having knowledge on manual testing and Qtp. i want Relavent experience in testing.watever may be d salary i dont bother..I just want to gain knowledge. i dont have good communication skills.

1418


i have a doubt can anyone tell me where are scripts stored while using QTP.Tell me the exact procedure takes place in real time?like how we call scripts how to proceed after writing scripts?how scripts are executed etc?i heard some use Qc whether others dont use.so tell me whole procedure for both the things it will be a very big help.as i have interview i want to have whole idea on this.its very urgent.

1369


write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object.. (give a filter condition only WEbelement- not easy need to use some more property while giving filter condtions- use google for your help...))

1494


hi i have 4 yrs exp in manual and automation testing using QTP i need sample resumes plz can u send this mail id pbre1980@gmail.com

1402


How will you check that your test cases covered all the requirements?

553