You are on page 1of 6

Faculty of Prince Al-Hussein Bin Abdallah II For Information Technology

Course: Graphic User Interface (GUI).


Instructor: DR.Maryam Al Zawahra.
Subject: GUI Testing.
Students:
1. Omar Khaled <1932546>
2. Mohammad Fakher <1931973>

What is graphic user interface testing?


Graphic User Interface Testing (GUI) testing is the process of ensuring
proper functionality of the graphical user interface (GUI) for a specific
application. This involves making sure it behaves in accordance with its
requirements and works as expected across the range of supported platforms
and devices.
Why is GUI Testing Important?
Modern computer systems are generally designed using the layered
architecture approach, this means that the core functionality of the system is
contained within the “business logic” layer as a series of discrete but
connected business components. They are responsible for taking information
from the various user interfaces, performing calculations and transactions on
the database layer, and then presenting the results back to the user interface.

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.

What Types of GUI Testing Exist?

There are two main types of GUI testing available:


● Analog Recording
● 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.

- The main benefits of analog recording are:

● It works with virtually all applications regardless of the technology or


platform used. Nothing is required of the application developer to make it
testable.

● 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.

- However, there are several major drawbacks to analog testing:

● 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.

- 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.

- The main benefits of object-based learning are:

● 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.

- However, there are some drawbacks to this approach:

● 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.

Which Type Should I Use?


the best practices are to use Object Based Recording that is more robust and reliable
where possible and then use Analog recording to “fill in the gaps” where nothing else
works.
What are the Challenges with GUI Testing?
● Repeatability – Unlike code libraries and APIs which generally are designed
to be fixed, user interfaces of applications tend to change significantly
between versions. So, when testing a user interface, you may need to
refactor large sections of your recorded test script to make it work correctly
with the updated version.
● Technology Support – Applications may be written using a variety of
technologies (e.g., Java or .NET) and may use a variety of different control
libraries (Java AWT vs. Java SWT). Not all control libraries are as easy to
test, and specific testing tools may work better for some libraries than others.
● Stability of Objects – When developers write an application, their choices
can determine how easy an application’s GUI is to test. If the objects in an
application have a different ID value every time you open a Window that
makes it much harder.

● Instrumentation – Some technologies are designed to be tested without any


changes made to the source of the application, however in some cases, the
developer needs to add special code (called instrumentation) or compile with
a specific library to enable it to be tested. If you don’t have access to the
source code in such cases, that limits the testing options.

You might also like