How u call functions in QTP

Answers were Sorted based on User's Feedback



How u call functions in QTP..

Answer / charan

syntax for function
fun <fun name>(arg1,arg2)
<statements>
end
for example if u want to call mul(3,6)
call mul(3,6)
function mul(a,b)
mul=a*b
end

Is This Answer Correct ?    23 Yes 1 No

How u call functions in QTP..

Answer / jayalakshmi

Function to calculate the length of characters in a word -

Function countChar(st)/*Vbscript Function
charLength = Length(st)
End Function

Assume above function countChar is written in VBscript, now
you are getting the text from the Application and calling
the Vbscript file and gets the length of the characters in
the word

Dim textValue
textValue= Browser("Browser Name").Page("Page Name").Frame
("mainFrame_5").WebElement("12").GetROProperty("innertext")

executefile "\*.*\countChar(textValue)" /*calling the
Vbscript file
textlength = charLength /*getting the text length

Is This Answer Correct ?    14 Yes 12 No

How u call functions in QTP..

Answer / hitendra

xyz=checkpal("LIRIL","LIRIL")
Function checkpal( strpal ,outstr )
If strpal =strreverse(outstr ) Then
print strpal &" " & strreverse(outstr )
checkpal="Is Palindrome"
else
checkpal="Is Not Palindrome"
End If
End Function

Is This Answer Correct ?    0 Yes 1 No

How u call functions in QTP..

Answer / ravinder

first diclare veriable in note pade and save in vbs file
after that go to new qtp program
use the publec ffunction
end function satement go to test resoruses and add
librarey file run the frogram

Is This Answer Correct ?    3 Yes 8 No

How u call functions in QTP..

Answer / manu

its as simple as calling vbs functions..

Is This Answer Correct ?    5 Yes 16 No

Post New Answer

More QTP Interview Questions

Explain different recording modes?

0 Answers  


In Object Repository, two actions r there. Action1 name is A.tsr, Action2 name is B.tsr. Is it Possible? if Yes, what is the out put of A+B? if No, why?

2 Answers   Kanbay,


How do you change Logical Name of the object in test script?

1 Answers   TCS,


• What type of testing questions will be asked for 2+ yrs exp people in interview?

0 Answers  


Diff b/n image n bitmap checkpoints?

2 Answers   iGate,






What is operator in VB Script?

1 Answers   IBM,


What is Curd testing?

0 Answers   Wipro,


In an application you have a web table. You are provided with an external Excel sheet with the same structure as that of the web table. How will you retrieve all data from the web table and compare it with corresponding data available in the excel sheet, using QTP? How will you report the results in QTP?

1 Answers  


whare exactly we have to use functions and sub routain

0 Answers  


anyone can explian about types of "Triggere Events" in QTP

1 Answers  


How to display the first 3 letters in these "ABCDEFGH" using qtp script?

6 Answers   Oracle,


we r conduction testing on a project USING QTP, regarding that project the object repository is full ? Till that project having objects that r not recognised by repository, then what wil you do? How we wil recogine remailning objects? Is it possible to maintain another shared(or)peraction repository? what is the maximum capcity of object repository? How the technical people decide this much object repository is enoughf for this project?

7 Answers   AppLabs, CGI,


Categories