Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compare Fields in DataTable for Checkpoint
#1
Solved: 11 Years, 4 Months ago
Hello all. I'm new to the board but been working on QTP for a while. Self taught for the most part.
I need to compare 2 caputured values on the Global DataTable and give a pass/fail checkpoint.
Can anyone help with this?


Brian
Figured it out...
Code:
If DataTable("A", dtGlobalSheet) = DataTable("B", dtGlobalSheet) Then
    Reporter.ReportEvent micPass,"Compare A and B in DataTable", "Passed"
Else
    Reporter.ReportEvent micFail,"Compare A and B in DataTable", "Failed"
End If
Reply
#2
Solved: 11 Years, 4 Months ago
Hi,
Suggestion:


How about storing the values in Variable and then compare. I think it is a good practice instead directly comparing it from the Datatable. This will also help you if you want to format or discrd anything that you want from DataTable.

Something like in DataTable you have 80.00 and you just want to compare 80 so you can use temp=Split(Var,".")(0)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] Compare value of List with DataTable robertosalemi 2 3,044 04-06-2016, 08:12 PM
Last Post: robertosalemi
  Compare WebTable Elements saraiado 1 2,559 06-11-2015, 06:54 PM
Last Post: venkatesh9032
  How to compare two binary values Naresh 0 2,349 09-09-2014, 05:06 PM
Last Post: Naresh
  How to check empty fields? ripchin 1 3,420 05-10-2014, 01:18 PM
Last Post: Ankur
  How to mask the particular read only mode fields while capturing screenshot in QTP kalaivanan123 2 3,533 03-18-2014, 11:31 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)