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?

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 conc..

Answer / reddz

try this way

k=cint(environment.value("a"))+cint(environment.Value("b"))
msgbox k

Is This Answer Correct ?    5 Yes 1 No

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

Answer / arun

Please try

Environment("a")=10
Environment("b")=20
msgbox (cint(Environment("a"))+cint(Environment("b")))

Is This Answer Correct ?    2 Yes 0 No

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

Answer / manjunathareddy

First Define User-Defined internal environment variable
To define an internal environment variable follow the steps
below
• Open the test in which you want to define the variable
• Navigate to File >> Settings >> Environment
• From the variable type drop down, select User-defined
• Click the plus button on top right
• In the pop-up you add name (variable name) say a and
value (variable value) say 10
• Again Click the plus button on top right
• In the pop-up you add name (variable name) say b and
value (variable value) say 20
• Click OK
-------------------------------------------------------
Dim c
c=Environment.Value("a")&Environment.Value("b")
Msgbox c

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

How is test case write?

0 Answers  


Explain in brief about the qtp automation object model (aom).

0 Answers  


what is the hierachy of Descreptive programming?

3 Answers   Fiserv,


What is Environment Variable and when we apply this in QTP?

3 Answers   TCS,


Hi all , I have installed the QTP 11.0 Whenever I am opening QTP that time if any open Internet Explorer I was getting message (Internet Explorer has encountered a problem and needs to close. we are sorry for inconvenience caused) and same way new browser also not opening. If you have any idea please let me know.

2 Answers   ME,






tell me about if in the interview what i should tell about pharma application,what r the pharma application concepts,i need pharma application testing features

0 Answers  


what is test data

4 Answers   Wipro,


Did QTP prove efficient for your project? Yes or No, explain?

0 Answers  


Hi all Can u give me the link where we can download full version of qtp my mail id is karthic.venkitapathi@gmail.com

0 Answers  


Pls can anyone give me the entire code for the Keyword driven framework with respect to he Flight Reservation Window in detail with explanation. Pls explain in detail stepwise. Thanks a lot. Pls very urgent?.

0 Answers   Logix,


What is text check point and text area check point?

0 Answers  


Tell me the situations where we will use Data Driven?

2 Answers  


Categories