A4 User Interface Testing
In this assignment, you will learn how to use a UI testing tool, create a UI test report, and create UI tests.
Definition
UI testing is
- Used to verify the reliability of User Interfaces and ensure the UI meets specifications
- Done through test cases
- Possible to do manually, but much more scalable through automation
Goals
- To determine if UI behaves according to specifications and in consistent ways
Mechanism
Graphical user interfaces can present problems that will not be readily apparent through regular source code testing such as unit tests. Some of these problems might be subjective and must be tested by human beings to determine their severity. However, it is possible to automate certain aspects of UI testing.
For example, it is possible to determine if all of the desired and expected elements are present after a web page is done loading.
Tools
Various tools exist to test user interfaces. These tools are usually highly dependent on the kind of UI being tested.
- Websites can be tested with tools such as Selenium.
- Tools such as Telerik can be used to test HTML AJAX and Silverlight applications
- Cucumber can be used to test system behaviour in a variety of languages, and can be used to run other UI tests.
- In mobile applications, we can use tools such as Espresso to automate UI testing.
Selenium - Features
We are going to focus on testing web UI in this assignment (with little focus on Playwright). Selenium is a framework for testing web applications. It is composed of multiple components such as Selenium IDE, which is a browser extension that can record and replay user interactions within a website. Selenium framework also contains a WebDriver, which allows programmers to write tests in a variety of programming languages using the Selenium API. These tests can then be run using most modern browsers to determine if the UI under test is functioning correctly.
Requirements
Please make sure that you have Maven and Java installed on your computer (try to install the same version).
- OS: macOS/Windows 10 (untested on other OS)
- Java: version 1.8
- Maven: version 3.8.5
- Google Chrome: version 120 (other version should also be fine)
Part A
Oh my god, it took me forever to mvn test and get chromedriver to run but thanks to MacOS Catalina(v 10.15.3): Error: “chromedriver” cannot be opened because the developer cannot be verified. stack overflow, finally worked.
Part B
Using Selenium and adding test case and asserts.
Part C
Do it for Firefox browser.
Part D
Compare a page between mobile and standard.
Part E
Learn Playwright and design a test.