hi,
i was adding the two numbers in qtp scripts but i didn't get
the answer. see my below script, i dont know wht is the problem.

i passed the value a=3 b= 2, i got the ans 32 instead of 5.
i thing the problem is to be c = a+b

my mail id karthis4u@gmail.com

Dim a, b, c
a = inputbox("enter the a ")
b = inputbox("enter the b ")
c = a + b
print c

Answer Posted / kavi

Hi,

prasad's code was right.. but we should pass values for the
function sum
dim a,b,c
function sum(a,b)
c=a+b
msgbox c
end function
x=sum(3,2)

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the check points can be inserted without recording?

815


How many add-ins comes by default with quicktest professional (qtp)?

753


Is it possible to change the values of analog recording?

810


If I change the property value at runtime is it effect is object repository?

833


How to use Environment parameterization? Explain with an example.

1715


How is recording done when a application is over lapping the QTP application it gives a message object not recorded

1751


Whats the realtime QTP testing process

2177


I am facing an issue of object identification with the dropdown element of DHTML grid. When I tried to recognize these different dropdown objects, QTP identifies only one object for all the dropdowns. Hence, selection of different data from different dropdowns list is an issue. To overcome this problem, i have used Descriptive Programming technique by creating different object descriptions which have all the other properties same but differ only in one property i.e. ‘X’ location of the element on the screen. Hence, i have created distinct object descriptions that would allow us to select values in different dropdowns. The code is given below. But still I am unable to identify distinct dropdown objects. ‘Object Description for Dropdown Cell Status Set objCellStatus = Description.Create objCellStatus("micclass").value = "WebList" objCellStatus("name").value = "select" objCellStatus("x").value = 219 ------ ‘X’ Axis value for cell status drop down ‘Object Description for Dropdown Sub Segment Set objSubSegment = Description.Create objSubSegment("micclass").value = "WebList" objSubSegment("name").value = "select" objSubSegment("x").value = "319" ------ ‘X’ Axis value for sub segment drop down Please help... This is specific to DTML grid(Drop down object)

1659


What do you to script when objects are removed from application?

806


how will load the object during runtime?

1798


what is the frame work in J-meter?

1822


how to know no.of mails in our g mail by using vb-script

1981


I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.

1485


can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?

1796


There is an excel file of 1 to 100 sheets how you will iterate through it?

756