[UFT] Compare value of List with DataTable
in my application I have a ListBox, I get all items with:
allGroups = SwfWindow("myApp").SwfList("listBoxGroup").GetROProperty("all items")
that it returns me:
In my DataTable I insert in one cell this values
If I use an easy IF condition, it doesn't work:
If allGroups = DataTable.Value("groups_to_expected", "Step 1") Then ....my code End If
The conditions is always FALSE.
Could be an error with new line char?
Could you explain how you Insert values into the Data Table. Do you do it manually or through scripts? I would want to take a look at the script where the data is inserted into the data table.
You could also save the items in an excel workbook (by entering all values in a single cell using line break) and then importing the workbook to UFT to check the condition.
Have you tried comparing the strings using strcomp()
Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
I have 2 variables. I capture one from a spreadsheet and the other from the subject line in outlook. . I want to compare the two and make sure they match . If they do, move on ( Next) If not, return a message saying they dont match. I have the Next loop working so I dont need help with that.
I'm certain my variables are captured. I have verified that with a msgbox.
Now.. I want to compare the two.
StrComp (expSubject, mailSubject, 1)
That line returns 1 but that means nothing to me. I need to do an If then Else for these two variables.
If expSubject is equal to mailsubject then loop to the next line , If not, give me a message saying the subject doesnt match.