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

Answers were Sorted based on User's Feedback



I am verifying the actual vs the input value to make sure that they been entered correctly. In the..

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

I am verifying the actual vs the input value to make sure that they been entered correctly. In the..

Answer / pitbull

Based on the above recommendation which I added, but the For is
within a For loop and the scripts run by adding a customer with the
info and then the above for loop comes in place and verify the
customer is added and then it goes back to the first for loop and
add another customer and verify again with the second for loop
above. But when the customer are verified I end up getting the two
columns again.

Is This Answer Correct ?    0 Yes 0 No

I am verifying the actual vs the input value to make sure that they been entered correctly. In the..

Answer / ashok kumar

What ever man... don't assign the
'Datatable.GlobalSheet.AddParameter("Customer_in _Apps","")'
line inside the 'FOR' loop, better to write this after the
ur variable declaration part.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How do you open adobe acrobat file in QTP and do some testing on that file ?

0 Answers  


Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?

1 Answers   Crea,


Hello everybody, can we maintain the state of page in QTP? 1. suppose i opened a notepad text file i entered some text and changed the font type and font size and saved that file. 2. Now next time when i will open a new notepad file it is showing me that font type and size which i changed in my previous step. 3. Here i want that QTP should capture the default setting i.e. it should maintain the state of the page. Thanks in advance, Gaytri

0 Answers  


Why a framework is needed?? Plaese post your answers ASAP

3 Answers   ACC, FD, Mphasis,


DIFFERENT RUN MODE IN QTP..1-VERIFY MODE 2-UPDATE MODE 3- dEBUG MODE. My question is in whic sitution we use these modes Explain me with example

1 Answers  






the build is develeped in Java. is possible to write scripting in vb using QTP ?

3 Answers  


how do u create new test sets in TD

1 Answers  


On a web application I want to select list item 5 from a dropdown list. but QTP identifying this object as winobject. Then how can we select list item 5 from that dropdown list.

4 Answers  


HI, Based On The Information Below Write A Data Driven test Script Edit Box 1 Should take Value From Num1 Column Edit Box 2 Should take Value From Num2 Column Click On Add Button, Get The Value Of Exp res Column, Get Value From Actual Result Edit Box , Compare Two Values, Write Pass / Fail Value Into Result Column Thanks In Advance... Kavitha Input.Xls Num1 Num2 Exp res Act res Result 10 30 40 40 Pass 50 40 90 90.5 - - - - - - - - - - - - - - - -

5 Answers   UHG,


How to test fly out menu in qtp?

0 Answers  


Set DR= CreateObject("Mercury.DeviceReplay")

2 Answers  


I am new with QTP. Is anybody could tell me where I can find a good tutorial with lots of samples?

0 Answers  


Categories