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

If I change the property value at runtime is it effect is object repository?

0 Answers  


We have a text file which contains 1 to 100 numeric values sequentially like 1 2 . . 100 Now we have to count them and transfer to XML file by writing a code in qtp.

1 Answers   Cap Gemini,


1.How recognize QTP Dyanamic Image? (suppose tha wedpage contains 3 logos..1 square 2.circle 3.rectangel)there changing at same position how to capture that)

3 Answers   Synechron,


what is use of the object repository?

4 Answers  


How open an excel sheet in QTP(not a run time )?

4 Answers   Tech Mahindra,






I am trying to write a descriptive program for clicking on a perticular link.For that i wanted an index or location of that object.But when I viewing through spy, There was no index property of that object.What to do for getting index value.How can I get index? please any one let me know.

5 Answers  


Which object repository we use in real time and can we merge 2 object repostiory and how?

6 Answers   HCL, Satyam,


Hi All, I have QTP installed on my machine but the application under test (AUT) is on remote desktop (i.e. I first connect to remote desktop from my machine in order to run the application). I am able to record the script successfully with QTP running on my machine and application running on remote. However, when i run the recorded script, system fails to run it and indicates me that it does not identify the object. Is it possible to record and play while QTP and AUT are not on same machine?

7 Answers   ABC,


w is active screen

2 Answers   GCI, Wipro,


Can we record an application running on a remote machine using qtp?

0 Answers  


How many types of recording modes in qtp?

0 Answers  


how do you do database testing in qtp

5 Answers   NIIT,


Categories