Graphical user interface testing (GUI) testing is the process of ensuring the correct functionality of the graphical user interface (GUI) for a given application. This test involves ensuring that the software meets its requirements and works as expected across supported platforms and devices.
Another purpose of graphical user interface (GUI) testing is menus, buttons, icons, etc.such as controlling screens and controls to ensure that the functionality of the software application works according to specifications.
Why is GUI Testing Important?
Modern computer systems are often designed using a ‘ layered architectural approach’:
This means that the basic functionality of the system is contained in the “business logic” layer as a series of discrete but connected business components. They are responsible for obtaining information from various user interfaces, performing calculations and operations at the database layer, and then presenting the results back to the user interface.
In an ideal world, the presentation layer to be very simple and adequate unit tests, code-level tests (for example, the external application program interfaces (APIs) if you have the API test), the business and data layers you can be complete only by testing with code coverage. However, reality is never that simple and you will need to test the graphical user interface (GUI) to cover all the functionality and have full test coverage. It can be said that this is exactly where the GUI test comes into play.
Testing the user interface (called a GUI when it is graph-based and a simple text interface) allows you to test GUI testing and functionality from a user’s point of view. Sometimes the internal functions of the system work correctly, but the user interface does not allow a user to perform actions. Other types of tests will miss this failure, so GUI testing is a good thing in addition to other types.
What Types of GUI Testing Exist?
There are two main types of GUI testing available:
- Object Based
- 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.
Relative Analog Recording
Relative analog recording is a type of analog recording in which the locations of interaction events are recorded relative to the upper-left corner of the application window.
Absolute Analog Recording
Absolute analog recording is called the other main type of analog recording. Here, the locations of events are recorded relative to the upper-left corner of the system screen.
The main advantages of Analog recording are:
- It works with virtually all applications, regardless of the technology or platform used. Nothing from the app developer is required to make it testable.
- Writing such tests is quick, 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 in active development.
However, there are several major drawbacks to analog testing:
- Tests are sensitive to changes in screen resolution, object position, window size, and scroll bars. This means you have to put extra effort into making sure you can standardize such factors.
- Tests are not smart; they do not search for specific objects (for example, the Send button), but are just a series of saved gestures. Therefore, if you change the user interface in any way (for example, if you move the button or change the button to a hyperlink), the tests need to be rewritten. For this reason, analog tests are called “Fragile”.
- When Analog tests perform an action, there is very limited feedback as the test tool simply clicks on a coordinate or sends a keystroke – the tool does not understand whether the application is working correctly, which makes human verification necessary.
Object Based Recording
When you use object based recording, the testing tool is able to connect programmatically to the application being tested and “see” each of the individual user interface components (a button, a text box, a hyperlink) as separate entities and is able to perform operations (click, enter text) and read the state (is it enabled, what is the label text, what is the current value) reliably regardless of where that object is on the screen.