Micro Focus QTP (UFT) Forums
[UFT] Compare value of List with DataTable - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: [UFT] Compare value of List with DataTable (/Thread-UFT-Compare-value-of-List-with-DataTable)



[UFT] Compare value of List with DataTable - robertosalemi - 03-29-2016

Hi,
in my application I have a ListBox, I get all items with:
Code:
allGroups = SwfWindow("myApp").SwfList("listBoxGroup").GetROProperty("all items")
that it returns me:
"item1
item2
item3
item4"

In my DataTable I insert in one cell this values
"item1
item2
item3
item4"

If I use an easy IF condition, it doesn't work:
Code:
If allGroups = DataTable.Value("groups_to_expected", "Step 1") Then
     ....my code
End If

The conditions is always FALSE.

Why?
Could be an error with new line char?

Thanks.


RE: [UFT] Compare value of List with DataTable - vinod123 - 04-01-2016

what kind of error message you got so that i can reply to you


RE: [UFT] Compare value of List with DataTable - robertosalemi - 04-06-2016

That the two string are not equals.