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

6 Answers   iton, TATA,


Explain Descriptive Programming Types with Examples?

0 Answers  


This is the script generated by qtp plz can anyone write the same script using descriptive programming plzzzz guys do answer. Browser("orkut - login").Page("orkut - login").WebEdit ("Email").Set "rgovard" Browser("orkut - login").Page("orkut - login").WebEdit ("Passwd").SetSecure "47525d8be4926ea2f6e96b9a3f7472b6ae38" Browser("orkut - login").Page("orkut - login").WebButton ("Sign in").Click Browser("orkut - login").Page("orkut - home").Link ("Logout").Click Browser("orkut - login").Page("orkut - login").Sync Browser("orkut - login").Close

6 Answers  


If there are 100 checkboes in a page then how can we select all chexkboxes at once through descriptive programing in QTP using vb script. Please send the answers...

5 Answers   HCL,


what is the defference between calling ation and called action?

1 Answers  






Suppose if a functionalityis not mensioned in requirement document and but its present in application. will it be consider as a bug and viceversa?

2 Answers  


Can a function return a dictionary object?

2 Answers   CG, Semantic Space,


How many types of Recordings are there in QTP and what are they?

7 Answers   Dangote, First Indian Corporation,


what are pretesting activities

0 Answers  


what is the hierachy of Descreptive programming?

3 Answers   Fiserv,


How to Compare the 2 xl-sheets in QTP? ple write the vb Script for the comparison?

1 Answers  


Can I compare two DataBases using QTP ?

1 Answers  


Categories