Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find matching value between values in 2 tables
#4
Not Solved
Code:
Dim rowcount, i, j, CatMatchFound
CatMatchFound = false
rowcount = datatable.GetSheet( "CategoryReportData").GetRowCount
'***Include 1 space after the last word in CategoryVal(ex. "Uniforms_") the _ represents a space****
        For i = 1 to rowcount
                 CategoryVal=datatable.Value("Category", "CategoryReportData")
                  CategoryTot = datatable.Value("Total", "CategoryReportData")
                  'msgbox (CategoryVal)
                   rowcountofcompare = datatable.GetSheet( "Check Detail Lines on Category Report").GetRowCount
                             For j = 1  to rowcountofcompare
                                    'msgbox( datatable.GetSheet( "Check Detail Lines on Category Report").GetRowCount)
                                     CompareVal =datatable.Value("Category","Check Detail Lines on Category Report")
                                     CompareTot =datatable.Value("Total", "Check Detail Lines on Category Report")
                                     ' msgbox(CompareVal)
                                                    If CategoryVal= CompareVal Then
                                                         CatMatchFound = true
                                                               If  CategoryTot = CompareTot Then
                                                                    Print "Match on Category Total Report :  "&(CategoryVal) &"  $" & (CategoryTot)& _
                                                                     " matches " &(CompareVal)&"  $" &(CompareTot)
                                                                      Reporter.ReportEvent 0, "Category Report Check" , "The Category and Total displayed on the report matches expected results."
                                                                     'Msgbox (rowcount) & " rows "&(CategoryVal)
                                                                           Else
                                                                                 'Print "Category Total report also included other invoices for this category:  " &(CategoryVal)
                                                                                  Print " WARNING : Partial match found. Please verify that the Category being "
                                                                                  Print "                 added does not exist and re-run the test. "
                                                                                  Print " *****************************************************************************************************"
                                                                                  Print "  Detail : The Category Total Report displays "&(CategoryVal) &"  $" & (CategoryTot)
                                                                                  Print "                     does not match expected values:  " &(CompareVal)&"  $" &(CompareTot)
                                                                                  Print " *****************************************************************************************************"
                                                                                  Reporter.ReportEvent 3, "Category Report Check" , "The Category and Totals displayed on the report do not match expected results. " & _
                                                                                    "The Category Total Report displays  "&(CategoryVal) &"  $" & (CategoryTot) & _
                                                                                    " which is not matching the expected values:  " &(CompareVal)&"  $" &(CompareTot)
                                                                                 'msgbox (CategoryVal)
                                                                  End If  
                                                                        
                                                   End If
                                                   DataTable.GetSheet("Check Detail Lines on Category Report").SetNextRow
                                            
                               Next
                                DataTable.GetSheet( "CategoryReportData").SetNextRow 'Insert Runtime datatable
       Next
                If (CatMatchFound = false) Then
                            Print "********************************************************************************************************"
                            Print "No matches found for Category - this message only displays if the Category.Value on the "
                            Print "Check Detail Lines on Category Report action did not match due to before and/or after     "
                            Print "spaces with each value. Correct by adding a space before or after the value and re-run    "
                            Print "********************************************************************************************************"
                             Reporter.ReportEvent 1, "Category Report Check" , "Actual does not match expected results for a match on Category"
               End If
Reply


Messages In This Thread
RE: Find matching value between values in 2 tables - by wheelercha - 01-25-2010, 08:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to Save a file in UFT 12.0.2 (Sequence contains more than one matching elemen) noeldsouza89 0 2,600 02-02-2015, 03:03 PM
Last Post: noeldsouza89
  Web tables dineshreddymca 3 4,479 03-15-2013, 07:02 AM
Last Post: basanth27
  How to read data tables in DBVisualizer sqadri 1 3,058 04-13-2012, 10:32 AM
Last Post: sshukla12
  Changing Index number of tables mv8167 4 6,637 08-25-2011, 08:36 PM
Last Post: luth
  2 local data tables per action? possible? davfinly 1 2,055 12-10-2009, 04:46 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)