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

How to retrive XML file data in QTP ? using Script(Chandana)

6 Answers   Wipro,


GET WHETHER THE GIVE NUMBER VALID OR NOT IN BETWEEN THE GIVEN RANGE?IN VB SCRIPT(QTP)

2 Answers   CSC,


how can we preform retesting(DATA driven test) using function please gine the code for loginpage

0 Answers   W3 Solutions,


How do we call Library Files(.vbs) in the Test Script Thanks in Advance...

6 Answers  


I want to assign values in a table in my software, in first column i will give values, table is of 4x4 i.e 4 row and 4 columns, i m using VBScript in my automation work. it is a simple table for giving values.

4 Answers   TCS, Wipro,






what is the extension of action script template?

7 Answers   Capco,


what is key word driven frame work how to use keyword driven frame in QTP in a project

1 Answers   AppLabs,


Why do we use breakpoints in QTP?

0 Answers  


What is VSS? Is it used in Automation(QTP) Or Manual? what is menus in VSS?

3 Answers   TCS,


What are they Advantages and Disadvantages in QTP 9.2?

1 Answers   Infotech,


With what extension you can save the list of tests in a file to run in test batch runner?

0 Answers  


what r the main attributes of test automation?

0 Answers  


Categories