GUI Testing Tutorial: User Interface (UI) Test Cases with Examples

What is a GUI?

For a computer application, there are two sorts of interfaces. The Command Line Interface (CLI) is a program that allows you to write text and have the computer reply to it. The Graphical User Interface (GUI) is a method of interacting with a computer that uses graphics rather than words.

The following are some of the graphical user interface components that may be used to interact with the application −

  • Radio Button

  • Check Box

  • Text Box

  • List Box

The aforementioned items are validated by GUI testing.

GUI Evaluation

GUI Testing is a sort of software testing that examines the product's graphical user interface. The goal of Graphical User Interface (GUI) Testing is to guarantee that a software application's features perform as expected by inspecting displays and controls such as menus, buttons, and icons.

The user interface is what the user sees. If you go to, the first thing you'll notice is the homepage, which is the site's GUI (graphical user interface). The source code is hidden from the user. The user may see the user interface. The attention is mostly on the design structure and whether or not the pictures are functioning properly.

If we have to undertake GUI testing in the example above, we first check that the graphics are fully displayed in various browsers.

The links are also available, and the button should function when pressed. Also, no graphics or information should shrink, crop, or overlap if the user resizes the screen.

This guide will teach you how to

  • What is GUI Testing and How Does It Work?

  • GUI Testing is Required

  • What do you do when it comes to GUI testing?

  • GUI Testing Methodology

  • Test Cases for GUI Testing

  • Demonstration − How to Run a GUI Test

  • GUI Testing Challenges

Need for GUI Testing

The fundamental principle of GUI testing is now evident. The following are some of the questions that will arise in your mind −

  • What is the point of GUI testing?

  • Is it truly necessary?

  • Isn't it true that testing the application's functionality and logic isn't enough? So what's the point of wasting time on UI testing?

Think like a user, not a tester, to find the answer. The user is unfamiliar with the XYZ software/application. The user interface of an application determines whether or not a user will continue to use it.

The design and appearance of the application/software, as well as how easy it is for him to grasp the UI, are the first things that a typical user notices. If a user is uncomfortable with the interface or finds the application difficult to comprehend, he will never use it again. As a result, GUI is a source of worry, and thorough testing should be conducted to ensure that GUI is bug-free.

Checklist for GUI Testing

The checklist that follows will ensure thorough GUI testing in software testing.

  • Check the size, location, breadth, length, and character or number acceptance of all GUI components. For example, you must be able to enter data into the input areas.

  • Verify that you can use the GUI to execute the application's intended functionality.

  • Check for Errors Messages are accurately presented.

  • Examine the screen for a clear distinction of separate portions.

  • Verify that the font used in the application is readable.

  • Verify that the text is properly aligned.

  • Make sure the typography and warning messages are in a suitable color scheme.

  • Check to see if the photographs are clear.

  • Verify that the photographs are aligned appropriately.

  • For varied screen resolutions, check the alignment of GUI components.

Techniques for GUI Testing

GUI Testing Techniques are divided into three categories −

Manual Testing − In this method, testers manually review graphical displays for compliance with the criteria given in the business requirements document.

Replay and Record − Automation tools may be used to do GUI testing. This is split into two sections. The automation tool captures test steps during Record. The recorded test steps are conducted on the Application Under Test during replay. QTP is one example of such a tool.

Testing based on models − A model is a graphical representation of the behavior of a system. It aids in the comprehension and prediction of system behavior. Models assist in the creation of effective test cases based on system requirements. For this model-based testing, keep the following in mind −

  • Create the model.

  • Determine the model's inputs.

  • Calculate the model's predicted output.

  • Carry out the tests

  • Compare the actual and anticipated results.

  • A choice on whether or not to pursue the model forward.

Some of the modeling strategies that may be used to generate test cases include −

  • Charts − - Shows the current state of a system and compares it to the current state after some input.

  • Decision Tables − - Tables that are used to determine the outcomes of each input.

Model-based testing is an approach for creating test cases from requirements that are still growing. Its biggest benefit over the other two approaches is that it can detect unwanted conditions that your GUI can reach.

The free source tools listed below can be used to do automated UI tests.

ProductLicensed Under
Robot FrameworkApache
Dojo ToolkitBSD

Test Cases for GUI Testing as an Example

Basically, GUI testing entails the following −

  • The components' size, location, width, and height are all being tested.

  • The error messages that are presented are being tested.

  • The various areas of the screen were put to the test.

  • The typeface is evaluated to see if it is readable.

  • Zooming in and out to test the screen in different resolutions such as 640 ☓ 480, 600 ☓ 800, and so on.

  • Check whether the text and other components such as icons, buttons, and so on are properly aligned.

  • Font colors are being tested.

  • Trying out different colors for error and warning messages.

  • Checking whether or not the image is clear.

  • The photos' alignment is being tested.

  • Spelling is being checked.

  • When utilizing the system interface, the user must not become annoyed.

  • Checking to see if the UI is appealing.

  • If there are any scrollbars, they will be tested in relation to the size of the page.

  • If there are any disabled fields, they will be tested.

  • The size of the photos is being tested.

  • The headers are checked to see whether they are correctly aligned.

  • The color of the hyperlink is being tested.

Demonstration: How to Perform a GUI Test

The following is an example of a test case, which includes UI and usability situations.

  • TC 01- Double-check that the text box with the label "Source Folder" is appropriately positioned.

  • TC 02 - Double-check that the text box with the label "Package" is appropriately positioned.

  • TC 03 - Double-check that the label "Browse" is a button at the bottom of the TextBox with the name "Source Folder."

  • TC 04 - Confirm that the label "Browse" is a button at the end of the TextBox "Package."

  • TC 05 - Double-check that the text box with the label "Name" is appropriately aligned.

  • TC 06 - Check that the label "Modifiers" has four radio buttons labeled public, default, private, and protected.

  • TC 07 - Check that the label "Modifiers" has four radio buttons that are appropriately positioned in a row.

  • TC 08 - Check to see whether the label "Superclass" beneath the label "Modifiers" has a dropdown that is appropriately aligned.

  • TC 09 - Double-check that the label "Superclass" includes a button with the label "Browse" that is appropriately positioned.

  • TC 10 – Check that the default mouse pointer is set to the hand mouse pointer when you click on any radio button.

  • TC 11 - Ensure that the user cannot type in the "Superclass" dropdown.

  • TC 12 - Verify that if anything is chosen incorrectly, an appropriate error must be generated.

  • TC 13 - Check that the error must be generated in RED everywhere it is required.

  • TC 14 - Check that the error messages have the correct labels.

  • TC 15 - Ensure that the single radio buttons are always chosen by default.

  • TC 16 - While jumping to another field next to the previous, make sure the TAB button is working properly.

  • TC 17 - Make sure that all of the pages have the correct title.

  • TC 18 - Check that the text on the page is appropriately aligned.

  • TC 19 - Ensure that a correct confirmation message is presented once any field is updated.

  • TC 20 - Make sure that just one radio button is chosen and that no more than one checkbox is selected.

GUI Testing Challenges

The most prevalent issue encountered during Regression Testing in Software Engineering is that the application GUI changes often. It's tough to test and determine whether something is a problem or an improvement. When you don't have any papers related to GUI modifications, the problem arises.


The success of a software product is largely determined by how the user interface interacts with it and how easy it is to use its many functions. As a result, GUI testing is critical. Manual GUI testing may be tedious and dull at times, making it prone to errors. For GUI testing, automation is strongly recommended.

Updated on: 30-Nov-2021

6K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started