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)

Answer Posted / ram

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How you can make an action as re-usable action?

757


Plz Explain AUTOMATION REFERENCE MODEL?

1763


We stored into the objects OR and then write the scripting

1630


Can we use index on view?

1710


Give the syntax to load function at run time.

737






What is meant by Output Value in UFT?

642


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

679


Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.

1474


What is QTP’s model for test creation?

770


Write a script to customize the test results in PDF and HTML format.

2177


How often were they executed?

2126


wht type of User defined functions or Java Releated functions Do we write in VB scripting

1467


What are the different types of checkpoints?

676


Explain about datafile/verification of date file when file is not available in local system?

2344


whare exactly we have to use functions and sub routain

1927