1

I am automating a windows application using Squish. I am trying to verify if the required text is displayed in a window after I make some changes in the GUI. I used object spy to get the object ID, but I am confused how to give a test verification point. The following Verification point says in the results window as 'True' and 'True' are equal. But I want it to be as, for example 4X and 4X are equal.

test.compare(findObject("{name ='textObjective'}").enabled, True)

Thank You!!

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
pigsrule
  • 33
  • 1
  • 7

1 Answers1

1

Instead of the enabled property, you can also compare any other property - e.g. the text:

test.compare(findObject("{name ='textObjective'}").text, "4X")
Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207
  • The recipe in my script keeps changing, so how do I compare the text for different tests? For example I have to test with different objectives like 4X, 20X, 0.30X etc. – pigsrule Sep 21 '16 at 18:31
  • @pigsrule You can use `test.verify` for that, e.g. `test.verify(any(findObject("{name ='textObjective'}").text in ["4X", "20X", "0.30X"]))`. In case you need to work with many different numeric values followed by 'X', a regular expression would be viable or some simple string manipulation. In either case, `test.verify` is your friend for populating the test report with the result. – Frerich Raabe Apr 22 '20 at 09:45