Thursday, 4 June 2015

GUI Test Automation Principles - Cause & Effect Check

When your automation code does something that should cause an effect in the AUT you should check that the expected effect did actually take place before the test continues.
One aspect of this is gui object syncronisation. When you take an action in your AUT that, perhaps, takes you to a new page or screen you should check that the AUT really is displaying that new page or screen before the test continues.

It's good practice to use a dynamic check for GUI elements, checking for the expected status every x seconds for a maximum time of y seconds.  e.g. checking every one second with a 30 second maximum timeout.  This makes the test resilient to variable response times in the AUT whilst avoiding unnecessary waiting.  This is preferable to hard coded maximum wait times.

This approach supports the Fail Fast principle.




AUT = Application Under Test