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?
Answer Posted / 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 View All Answers
I have written a code to fetch values fro access db and place in the fields. Iam using GetROProperty to fetch runtime values. Now i want to add runtime values to the access db in field v3. please help me. Its not writting in the db. Option explicit Dim con,rs,db,c Set con=createobject("adodb.connection") Set rs=createobject("adodb.recordset") con.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=D:\Sales.mdb" rs.open "select * from tax",con Do while not rs.eof Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("incost").Set rs.fields("v1") Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("intax").Set rs.fields("v2") c=Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("outtax").GetROProperty("value") rs.MoveNext print c Loop Do while not rs.EOF rs.EditMode rs.Fields("v3").Value="3" rs.Update rs.MoveNext Loop Set rs=nothing Set con=nothing
Explain about Test Fusion Report of QTP?
Mention the test steps of qtp.
How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.
Differentiate the type of test cases which can be automated and which cannot be automated?
Name the different types of recording modes?
What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?
What is environment variable in qtp and why to use it?
What is difference between shared and local object repository?
what is impact analysis on regression testing?
Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji
What is the script for database check point, bitmapchek point, regular expression ?
If the objects hierarchy is changing from build to build, then how you will handle that condition?
What is the difference between keyword view and expert view?
What is a programmatic description?