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
Answer / reddz
try this way
k=cint(environment.value("a"))+cint(environment.Value("b"))
msgbox k
| Is This Answer Correct ? | 5 Yes | 1 No |
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 |
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 |
What exactly a frame Work means?what are the different type of frameworks done in QTP?why the caption for QTP given as advanced keyword driven?
How to export QTP results to an ".xls" file?
write vbscript in qtp tool for senario, in the given sheet add each number in each row and each colunm and show result
What is the dis advantage of check points in QTP, if any?
How to make arguments optional in a function?
what is option explicit? what is the use of it?
can objects recogonised without repository?
How do you test siebel application using qtp?
How to use regular expression in descriptive programming?
How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?
what is the difference between data driver & data driven and driver script?
images are dynamically changes how to compare two images