Forum Discussion
- Colin_McCraeCommunity Hero
All the time.
It's a common automated testing problem.
I have validation routines that check for existence and visibility of pretty much any object a script is about to use. If it doesn't come back as TRUE (exists & visible on screen), then I can't use the object and log some sort of error message instead.
I use the same routine to check the opposite condition as well. ie. to make sure an object that's expected to vanish has actually vanished.
The routine takes in:
- An object locator reference.
- Whether the object should be present or not.
- How long to wait for that condition to be achieved.
It's one of the most heavily used routines in my scripts. Without it, things would fail, crash, and get in a total mess all over the place. And one of the top priorities for ANY automated test for me is that it is almost impossible to crash it. If I'm running 8 hours worth of automated tests, I don't want to be having to check if it's crashed every 20 minutes.
Robustness. Robustness. Robustness.
It's so important I said it three times. :smileyhappy:
- tristaanogreEsteemed Contributor
Preach, Colin_McCrae
SumanthKotha get VERY familiar with built in methods like "WaitChild" or "WaitAliasChild" or "WaitProcess" as well. These are VITAL to that robustness that Colin mentions when it comes to testing existence of an object. Just checking "Exists" on an object will generate warnings and errors if the object does not exist... using "WaitChild('ObjectName').Exists" takes care of that.
Learn them. Use them. Love them.
- SumanthKothaOccasional Contributor
Colin_McCrae and tristaanogre Thanks for info. Actually in my scenario, the application is developed in Java and a window is there where it was recognized for the first time and i did all my operations which i want to do, later i have button call "Next" which takes the same window to loaded with different objects, here also i was able to do all the operations which i want to do, now in this window i have "Back" button, once i click, it load the previous objects into the window now this time the same objects which was recognized earlier now its saying not able to recognize. i tried to declare the page objects again (thinking the old variables values might have become null when i move NEXT and BACK).
- tristaanogreEsteemed ContributorI'm with Colin in this... the navigation "Back" may not, under the covers, take you to the same form... or, at least, some of the properties of the page, etc, may have gotten altered. Do an inspection at the failure point and compare it to what is actually mapped.
Related Content
- 7 years ago
- 5 years ago
Recent Discussions
- 14 hours ago
- 23 hours ago
- 2 days ago