UI stands for user interface. There are two types of user interface:
the Command Line Interface (CLI) and
the Graphical User Interface (GUI).
Graphical user interface is the graphical layout of the application. It consists of the text the user reads, the buttons and/or links the user clicks on, images, text input fields and all other elements the user interacts with. In this article, we will focus on GUI testing only.
UI testing means user interface testing. It is a testing technique used to identify user interface defects. The goal of UI testing is to verify that the UI provides users with corresponding access or browsing functions through the functions of the test object and that it meets company and/or industry standards. UI testing plays an important part in the software development process.
How do we conduct UI testing? Under normal circumstances, we conduct UI testing by directly comparing all the pages in an application with UI design assets to confirm that they are consistent. But, how do we test if there are no UI design assets provided? Below are some aspects that need to be considered during the UI testing process:
Verify the position of the elements on a page is correct - whether it’s centered, left-aligned, right-aligned, top-aligned, or bottom-aligned. For example, see the table below. The column “Name” is left-aligned, the column “Email Address” is center-aligned and the column “Age” is right-aligned.
Verify the text on the pages is displayed correctly, not truncated or overlapping with each other.
Verify the text font is the same on all the pages, or at least from the same font family.
Verify the error messages displayed on the pages are easy to see, errors are normally in red. See the red error message below as an example:
Verify the image is clearly shown, not broken.
Verify the image does not appear stretched or squeezed.
Verify the image alignment is correct on the page, whether it’s centered, left-aligned, right-aligned, etc.
Verify the image size is self-adaptive, i.e. under different sizes of mobile phone screens or web browser windows, the images can be displayed adaptively without stretching or squeezing.
Image and text should be well arranged and not overlapping. See the below screenshot as a good example of displaying image and text:
Verify it has a placeholder text.
Verify there is a tooltip for the text box.
See the below screenshot, the text input field has a placeholder text and no tooltip.
Single Selection (Radio Button)
Verify it has a default selected option.
Verify that the current option is automatically deselected when another option is selected.
See the below screenshot, it has a default option and only one option can be selected.
Multiple Selection (Checkbox)
Verify that it has a default option.
When other options are selected, the current options should not be affected.
Verify that the selection takes effect by clicking the selection box or clicking the text label.
See the below screenshot, multiple options can be selected.
There should be different styles for non-clickable and clickable buttons. Look at the below buttons, the left one is not clickable, the right one is clickable.
There should be different styles for the selected tab and the unselected tab. See the below screenshot as an example, the “ITEM ONE” tab is selected, the other two tabs are unselected.
There should be different styles for the OFF and ON states. See the screenshots of the iPhone Battery Setting, the OFF state is in gray.
There is no need to have scroll bars when the content on a page can be completely displayed.
When a page cannot be displayed, a scroll bar is required, and the style of the scroll bar must be consistent with the overall style of the UI. See the below screenshot as an example - the scroll bar is displayed while scrolling down:
For web applications, UI testing should be conducted with commonly used web browsers. For mobile applications, UI testing should be conducted with different mobile devices supported by the mobile applications.