adspace


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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is actually contain test report? can anybody post the test report

2088


HOw to add the recovery file at runtime to the test file .

2291


Tell some commonly used Excel VBA functions?

1130


How can you identify the browser and its information using QTP script?

1085


Hi friends did any budy attend accenture system test for qtp? if any budy pls drop questions.not only accenture any other mnc company which you attended system test(QTP)?it may helpful to others also

2396


Any body have QTP 9.5 licence key. please provide me at madhukar_dec30@yahoo.co.in

2079


Please help me by providing the License key for QTP 9.2, at guru_aarya@yahoo.co.in Best Regards Gururaj.B

3446


Hi,Sudhanandareddy plz forword framework and ppts for QTP to me. This is my mail id: ranjith_99reddy@yahoo.co.in (your contact number also)

2560


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

2005


can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?

2166


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

2154


if anyone has idea of the interview procedure in covansys, plz send me a mail?

2062


hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.

2428


any body can you help me what is the script to automate an comand promt

2565


i need qtp tutorial. pls send it to sridhar.k151@g mail.com

2173