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

can we take 'dim my pen is good' as a paramerter

2 Answers  


Where we use data driver in qtp?

0 Answers  


What type of automation frame work you are using?and why?

2 Answers   Wipro,


hi Sudhananda reddy, in my resume, i written as , I Am working as a Test Engineer for xyz company. IS IT RIGHT OR WRONG? WHAT IS THE ACTUAL meaning of "IN XYZ COMPANY", "FOR XYZ COMPANY", "WITH XYZ COMPANY".

2 Answers  


Suggest and Define a solution for an application whose objects are not recognized by UFT?

0 Answers  






Can any body please tell me the steps of keyword driven frame work in qtp. My mail is saswat445@gmail.com please send some materials on keyword driven testing in qtp. thanks a lot...

0 Answers  


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

3 Answers  


desribe a situation where u faced a stressful situation and how did u cope with it

0 Answers   DELL,


When i used this below script to insert value in the Datatable... At run time it was inserting the given value in the specified column, But after execution all those inserted values were cleared automatically... datatable("column name",sheetid)=value

1 Answers  


hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me

0 Answers   TCS,


example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?

9 Answers   Tech Mahindra,


Hi, OUR PROJECT NAME IS: HOSPITAL CONTROL SYSTEM. IS IT COMES UNDER WHICH DOMAIN(HEALTH CARE OR HEALTH INSURANCE)

4 Answers   Four soft,


Categories