I have 2 Environment variable which holds int. I called
into my test and addedup. but output is concatenating the
values instead of Sum. Ex. Envi("a")= 10, Envi("b") = 20,
c= Envi("a")+ Envi("b"). msgbox c ( Ans.1020). How to
overcome this pblm? I used the add fn also..

Answers were Sorted based on User's Feedback



I have 2 Environment variable which holds int. I called into my test and addedup. but output is co..

Answer / sudarshan

Use
c= Cint(Envi("a"))+ Cint(Envi("b"))

Is This Answer Correct ?    14 Yes 0 No

I have 2 Environment variable which holds int. I called into my test and addedup. but output is co..

Answer / murali yeluri

yes, u r right. I got it. thanx

Is This Answer Correct ?    4 Yes 0 No

I have 2 Environment variable which holds int. I called into my test and addedup. but output is co..

Answer / neeraj kumar

Hi! Try this code, hope you will get the right answer.....

Environment.Value("MyVariable")=10
A=Environment.Value("MyVariable")
Reporter.ReportEvent micPass, "The value of A: ", A
Environment.Value("MyVariable1")=20
B=Environment.Value("MyVariable1")
Reporter.ReportEvent micPass, "The value of B: ", B
C=A+B
msgbox C

if i am wrong please confirm me back...


Regards
Neeraj Kumar

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More QTP Interview Questions

What is the function of Filter in QC . give with a real time example.

1 Answers   TCS,


After running scripts how you report results ,there is any specific report form

1 Answers  


Without integrating QC/Testdirector with QTP, is it possible to keep track of the defects?If yes how? How to export QTP results to an excel sheet?

0 Answers  


. My application is updating the user information in the application. Every time it is Adding on record in my application and Validating the information like “Record has added successfully”. Which Check point I have to put in this situation? Why?

5 Answers   Polaris,


how we connect 1. qtp9.2 to the quality center9.0? 2. Load runner8.0 to the quality center9.0

0 Answers  


How to Display last item of a Combobox by using QTP?

10 Answers  


I have a login page like username, password and login. I have to pass the 50 user names and 50 passwords but how can i test this page with out using parameters?

2 Answers  


how can i call reusable action in a function could any one explain me?

2 Answers   Livetek,


Explain measuring transaction.

0 Answers  


write script to read and write data from file ?

2 Answers   HealthAsyst,


what is vss and cvs what is main difference b/w these two

3 Answers  


how to create user defined functions in QTP? can any one expalin me with example.. Thanks in Advance for help

4 Answers  


Categories