I have two For loop, first For loop does is creates a
customer and input the customer info and then the second for
loop within the first for loop does the follows which is
capture the customer name and verify the with the data
within the datatable. The problem I am coming across is that
when it goes through the second time creating another
customer and then verify the second customer then it creates
the following during runtime. I want is to have the
customer2 below Customer1 under the Customer_from_Apps. Any
help will be greatly appreciate it.
Customer Customer_from_Apps Customer_from_Apps1
Customer1 Customer 1 Customer2
Customer2
Window("Customer Desktop").Window("Customer Tracking
(Privacy").WinObject("TreeView20WndClass").Click 92,244
runtimevalue =
.VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio
n")
Customer_Val= Datatable.GlobalSheet.AddParameter
("Customer_from_Apps",runtimevalue)
row=datatable.getsheet("Global").GetRowCount
For x=1 to row
datatable.SetCurrentRow(x)
Data_Val=Datatable.Value("Customer",dtGlobalSheet)
If (trim(Customer_Val)=trim(Data_Val)) Then
Reporter.ReportEvent micPass, "Customer validation
successful", "Actual Value: " &Data_Val&vbcrlf& "Customer
Value: " &Customer_Val
else
Reporter.ReportEvent micFail, "Cusotmer validation
unsuccessful", "Actual Value: " &Data_Val&vbcrlf&
"Customer Value: " &Customer_Val
End If
Next
Answer / Sarjana Kaur
To achieve your desired output, you can modify your code as follows:nn```vbnetnDataTable dtGlobalSheet = New DataTable(""Global"") nDim Customer as StringnFor x=1 to rown datatable.SetCurrentRow(x)n Data_Val=Datatable.Value(""Customer"",dtGlobalSheet) n If (trim(Customer_Val)=trim(Data_Val)) Thenn Customer = Data_Val & vbcrlf & Customer n Elsen datatable.AddRow() n datatable.SetValue(""Customer"", dtGlobalSheet, Customer)n Customer = Data_Val & vbcrlf & vbcrlfn End IfnNextnDim rowNew as IntegernrowNew = datatable.GetSheet(""Global"").GetRowCount()ndatatable.SetCurrentRow(rowNew)ndatatable.SetValue(""Customer_from_Apps1"", dtGlobalSheet, Customer)n``
| Is This Answer Correct ? | 0 Yes | 0 No |
How do we edit the script in QTP. Anybody can explain in detail..Thanks in advacne...
WHAT IS THE DIFF BTW KEYWORD DRIVEN TESTING AND DATA DRIVEN TESTING?
How to open a new test using quicktest professional?
Hi Friends, I'm new to QTP. I want to write a function in QTP for below senario. In an Excel sheet column B, I Have 10 Url/Links, and in Colum A there is a Flag as Y and N. My test should run only on those iterations which are flagged as Y. Please help, Thanks
how do u plan test automation?
how will you check how many members visited the website www.infosys.com?
What are FAST and NORMAL modes in qtp ? Why r these modes intended for ?
Do we get any issues if we run the testscript on different browsers? what are the options we need to st in QTP?
How to send the qtp results file by email (Lotus notes).
the build is develeped in Java. is possible to write scripting in vb using QTP ?
Definationions for keyword view and tree view?
How can we add regular expression for date field (dd/mon/yyyy)?