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 run-time object property in Object spy in QTP9?

3 Answers  


Is there a function to find the number of occurrences of sub strings within a string?

1 Answers  


how to find that tools work well with your existing system?

0 Answers  


What is Optional step?

4 Answers  


how u test a frame in a web page using QTP?

1 Answers   Accenture, IBM,






Can any body tell me what is the method to connect the remote desk top throw QTP 9.2 version?

1 Answers  


how to compare two excell sheets by using vbscript??

2 Answers  


In a Web appl, on a page, there are student names & details listed.On clicking sort button,details are sorted on Names.How do u verify htat sorting is done by using QTP?

1 Answers   IBM,


How to export data present in Datatable to an ".xls" file?

2 Answers  


how we can take data in the username field text box into variable in web application explain with example and give all functions to get data into variables

1 Answers  


Do we get any issues if we run the testscript on different browsers? what are the options we need to st in QTP?

2 Answers   BirlaSoft,


How iteration is related to Test Results in QTP?

1 Answers  


Categories