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
Hi this is chandra if any one have Navigation of LAB QTP, I want Navigation of those tools, if any one have the and know the Navigation each and every part of the QTP, plz send me my mail naruboinac@yahoo. com,naruboinas@ gmail.com
Hi! My OTP script has several bitmap checkpoints included which I check in the test results xml file. The test is for SAP 4.7. I need to save these bitmaps to files or at least export them to the html file using the export function in the test results viewer. Could you please help me with this problem? Thank you in advance! Best regards, Peter
Hi Friends, Would be great if you can provide the Model Question paper, Web site link or any reference s. Thanks & Regards, Byzoor,
How to save your test using quicktest professional (qtp)?
What is the XML file architecture ?
Explain the qtp test phases.
How can I change object description or check point values in qtp?
Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay
how to write xml output check point bu useing descriptive programing .means without useing output check point
Explain the check points in quicktest professional (qtp)?
Explain different checkpoints in qtp.
Explain about Test Fusion Report of QTP?
Is it possible to call win runner script in qtp?
In what occasion we can specify global sheet and action sheet?
What are the different types of functions available in qtp and explain ?