User Interface Testing. What is UI Testing and Why it is so important?
1,119 views
21 slides
Mar 04, 2022
Slide 1 of 21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
About This Presentation
UI is the visual part of a software application that determines how a user interacts with an application, or a website, and how information is displayed on the screen. The UI contains buttons, menus, text fields, and other controls that the users interact with when using an application.
In this pres...
UI is the visual part of a software application that determines how a user interacts with an application, or a website, and how information is displayed on the screen. The UI contains buttons, menus, text fields, and other controls that the users interact with when using an application.
In this presentation, you will read what UI testing is, and why it is so important, also by designing and creating a UI automated test with a practical and easy example.
t
e
s
t
i
n
g database
User
Interface
•UI tests are very powerful
because they go "end-to-end"
from the UI layer down.
End-to-end means testing all the
different parts of an application
from beginning (the user
interface) to end (the underlying
services, the database
connectivity, etc.).
•It gives an idea of how many tests we
should have in each of these groups.
•On the bottom of the pyramid, there
are unit tests that run fast and strongly
isolate the tested system parts. On the
top there are UI tests that are slow and
require little isolation.
•CONS. UI tests tend to be slow and fragile.
•Slow. Those tests are slower (e.g., respect to unit tests) because they go
through more layers of the application-under-test → Slow feedback to the
team.
•Fragile. They could be brittle if they are tightly coupled to the user
interface: the smallest change in UI or functionality can break one or more
tests
First, she would have to navigate to the
login page.
Once there, she would enter her username
and password.
Next, by clicking the Sign In button she
would logging in into the system.
1.navigate to login page
2.check the login page URL
3.check the username field is editable
4.enter (valid → allowed chars) username
5.check the username is correctly inserted
6.check the password field is editable
7.enter (valid → allowed chars) password
8.check the password is correctly inserted
9.check Sign-in button is enabled
10.click Sign-in button
11.check for presence of the ‘Welcome!’ string
2.Enter valid Username "John Smith" The username field is filled with the value “John Smith"
3.Enter valid Password "tZ3!Sz@C" The password field is filled
4.Click Sign In button
The Welcome message is displayed at
https://localhost:8080/welcome
This test case can be executed manually ("as is") or automatically.
/* check the Sign in button is enabled */
assertTrue(ok.isEnable());
/* click the Sign in button */
ok.click();
/* the Welcome message */
GuiHtmlElement message = new GuiHtmlElement(AccessibleRoleMaveryx.WEB_H1);
/* check the Welcome message text */
assertEquals("Welcome!", message.getText());
* assertEquals("Welcome!", message.getText()) allows cheking for spelling mistakes...
** you could also add a check on the Sign in button foreground color