I am verifying the actual vs the input value to make sure
that they been entered correctly. In the Global Sheet I have
a column called Customer with the multiple names in each row
and now I am trying to capture the value during runtime
under the column name Customer_in_Apps.

Somewhat it works but during runtime the values are being
stored in each column vs each row i.e., Customer_in_Apps,
Customer_in_Apps1. Automatically it add columns instead of
rows.

row=datatable.getsheet("Global").GetRowCount
for x=1 to row
datatable.getsheet("Global").SetCurrentRow(x)
Window("Customer Desktop").Window("Customer Tracking
(Privacy").WinObject("TreeView20WndClass").Click 92,244
runtimevalue =
.VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio
n")
Val1=Datatable.Value("Customer",dtGlobalSheet)
Val2 = Datatable.GlobalSheet.AddParameter("Customer_in
_Apps",runtimevalue)

If (trim(Val2)=trim(Val1)) Then

Reporter.ReportEvent micPass, "Customer validation
successful", "Actual Value: " &Val1&vbcrlf& "Customer
Value: " &_Val2
else

Reporter.ReportEvent micFail, "Customer validation
unsuccessful", "Actual Value: " &Val1&vbcrlf& "Customer
Value: " &Val2
End If
Next

Answer Posted / ashok kumar

Hi,

Here the problem is 'AddParameter' used inside the 'FOR'
loop, when QTP runs it successfully add your column
successfully at first time, when the second iteration
perform QTP will check whether the column name is exist
previously or not, if it exist it append numeric, that so u
got N number of column, for that u need use 'AddParameter'
before the loop, below is modified of ur script:

row=datatable.getsheet("Global").GetRowCount
Datatable.GlobalSheet.AddParameter("Customer_in _Apps","")
For x=1 to row
datatable.getsheet("Global").SetCurrentRow(x)
Window("Customer Desktop").Window("Customer Tracking
(Privacy").WinObject("TreeView20WndClass").Click 92,244
runtimevalue =
.VbTreeView("vbname:=AppServerTree").GetROProperty("Selection")
Val1=Datatable.Value("Customer",dtGlobalSheet)
DataTable.Value("Customer_in _Apps",dtGlobalSheet) =
runtimevalue
Val2 = Datatable.GlobalSheet.AddParameter("Customer_in
_Apps",runtimevalue)
If (trim(runtimevalue)=trim(Val1)) Then
Reporter.ReportEvent micPass, "Customer validation
successful", "Actual Value: " &Val1&vbcrlf& "Customer Value:
" & runtimevalue
else
Reporter.ReportEvent micFail, "Customer validation
unsuccessful", "Actual Value: " &Val1&vbcrlf& "Customer
Value: " & runtimevalue
End If
Next

Hope.. it will be usefully for you...

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do you create a text checkpoint on a Web application? What is the purpose of the Close method?

1347


When we r doing data driven test with chkpts, i want to insert formulae in data sheet but i didn't get. How we wil do that plz. explain in detail.

1597


What is optional step in qtp? How you can add optional step in qtp?

524


Explain about Test Fusion Report of QTP?

607


What are the advantages of qtp?

574






Where you are storing your script?

627


Can we create user defined functions in qtp?

548


How to customize checkpoints with parameters?

3014


hi guys, pls tell me for testing institution training hub, hitech city is best or not?

1309


Give me At Least 5 Differences between DOCUMENTATION OBJECT MODEL(DOM)and COMPONENT OBJECT MODEL(COM)? Interviewer said me to WRITE the difference only in points not as you WRITE a paragraph ???? only in points

1615


What is the extension of the qtp local repository?

557


What is test object?

689


How do we handle run-time errors?

568


hi frinds i need help .i have 4 + yrs exp in testing and nearly 2 yrs exp in QTP and QC .currently iam working north fast 2 yrs iam looking for job in south is there any openings plz letme know my mail id is pbre1980@gmail.com

1559


What is the use of "New Property" in "Add properties" of testobject properties in object repository. How can i use "New properties" while writing scripts if i have assign some values to the testobject properties Can anyone help me? plz

1468