Professional Documents
Culture Documents
In an ideal world, the presentation layer would be very simple and with
sufficient unit tests and other code-level tests (e.g., API testing if there are
external application program interfaces (APIs)) you would have complete
code coverage by just testing the business and data layers. Unfortunately,
reality is never quite that simple and you often will need to test the Graphic
User Interface (GUI) to cover all the functionality and have complete test
coverage. That is where GUI testing comes in.
- Analog Recording:
This is often what people associate with GUI testing tools. With analog
recording, the testing tool basically captures specific mouse clicks, keyboard
presses and other user actions and then simply stores them in a file for
playback. For example, it might record that a user left-clicked at position X
= 500 pixels, Y = 400 pixels or typed the word “Search” in a box and
pressed the [ENTER] key on their keyboard.
● It is quick to write such tests and as long as the GUI is stable and you can
guarantee the screen resolution and window position, it can be a good way to
test older applications that are not under active development.
● The tests are sensitive to changes in the screen resolution, object position,
the size of windows, and scrollbars. That means you need to spend extra
effort making sure you can standardize such factors.
● The tests are not intelligent; they don’t look for specific objects (e.g., the
Submit button) but are just a series of recorded gestures. So, if you change
the UI (e.g. move a button, or change a button to a hyperlink) in any way,
the tests will need to be rewritten. For this reason, analog tests are referred to
as “brittle”.
● When analog tests perform an action, there is very limited feedback since the
testing tool is just clicking at a coordinate or sending a keypress - the tool
does not understand if the application worked correctly, making human
validation essential.
● The test is more robust and does not rely on the UI objects being in a certain
position on the screen or being in the top-most window, etc.
● The test will give immediate feedback when it fails, for example that a
button could not be clicked or that a verification test on a label did not match
the expected text.
● The tests will be less “brittle” and require less rework as the application
changes. This is especially important for a system under active development
that is undergoing more UX changes. For older, legacy applications this may
be less important.
● The testing tool needs to have specific support for each of the technologies
being used in the application. For example, if you have a web page that
contains a Java applet and a Flash application embedded, you will need to
have a testing tool that understands all three technologies (Java UI Toolkit,
Flex Runtime and the HTML DOM).
● For some technologies (e.g., Flex, Flash) the developers need to add
instrumentation to their code so that the testing tools are able to “see” the UI
objects. If you don’t have access to the source code of the application, then
it’s not possible to test it.
● Writing the tests may take more skill than simply clicking and pointing, you
need to be able to use Spy and inspection tools to navigate the object
hierarchy and interact with the right UI elements.