I am just a beginner in QTP. Could any one explain me in
detail how to automate adding two numbers and getting the
result in QTP. Also I would like to parameterize the
inputs. I have tried but getting an error like 'Can't use
sub.....'(can't recollect the exact error)
Answers were Sorted based on User's Feedback
you can write function to add two numbers and call in qtp.
file-->New-->function Library
Public function add(a, b)
add=a+b
End Function
Save it where ever u want with add.vbs
Now File-->settings-->Resources-->Add function library--
>click at add(+) button below one button will appear click
that and add the saved library file(add.vbs).
in qtp normal file
write print add(4,5) and u can parameters as your wish.
add this in
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sailaja
One way is:Dim a,b,c
a=10
b=20
c=a+b
msgbox c
Anotherway:Place the input parameters in these: edit-
>Action Properties->Parameetrs->Here we can add input &
outputparametrs.
Dim a1,b1
a1=Parameter("a")
b1=Parameter("b")
c=a1+b1
msgbox c
Aliter: Add the values of both a,b of parameters in Action
Properties.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the different scripting languages you could use when working with QTP ?
If the object property is changing very frequently, what was your approach?
How to Analyze the Checpoint results with Standard Checpoint ?
how can we perform web datatable operations on webpages(Like rowcount,col count,cell data)?
If an application name is changing frequently i.e while recording it has name “Window1” and then while running its “Windows2” in this case how does QTP handle?
Can I import a excel sheet in Action1 datatable? How?
Hi, how can we retrieve a specific value from Excel Sheet (Not datatable. for externel file).i mean to say from .xls file. and also tell me from xml file and .doc file. and how can u parameterize ur script from .xls file.(Not data table).
Hi all, i have installed QTP8.2 in my system. but script is not generating while recording. What is the problem? is any file missing? pls let me know anybody...Thnaks
how to explain a claims and insurance project?
what kind of erros can be handled with the using QTP?
"What are the common constrains that we need to consider when we prepare testcases for ASP application". Thanks in Advance...
write vbscript in qtp tool for senario, in the given sheet add each number in each row and each colunm and show result