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 use of sendkeys.In which cases we Use this sendkey.Pls explain with example.

3 Answers   Cap Gemini,


Cn u please clarify my doubt Where are micTab and micReturn used.Thanx in Advance

2 Answers  


What are the disadvantages of recording test cases in qtp?

0 Answers  


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

0 Answers  


What is the latest version of QTP? aster googling i found it 9.5 . but somewhere in my frnds resume i hve seen 10.0 so i am a bit confused pls let me know.

4 Answers   NCR,






Give me diffrent script in QTP for Webpage(Java and .Net),WindowsBased Applications,Java application,.Net application...

2 Answers   TCS, Virtusa,


what is the difference between the modular framework and datadriven frame work

2 Answers  


what is ODC and GDC?

0 Answers   Patni,


what are the difference between qtp8.2 to 9.0 surya

1 Answers   Bally Technologies,


What is difference between web object and web items

2 Answers   Patni,


hi to all, i need a code.. in flight application 1.i need to login first then i need to insert 3 new orders... 2.i have to log out 3.i have to login again with different user 4.need to insert 2 new orders 5.then need to log out 6.then again login with different user 7.3 new orders create and log out 8.but we hv to do this using data table and actions please help me

0 Answers  


Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?

0 Answers   BirlaSoft,


Categories