GUI Testing
Graphical User Interface is where all functionality comes together and interacts with the underlying code.
- It's a set of visual manipulable objects called controls or widgets.
Each widget has/Users/tran/Developer/oose-sp23/sp23-oose-project-team-11/react-native-firebase/tests/backend/translocAPI.test.js
- a set of properties where each property has a value at any point of time during execution
- a set of events associated with it
- E.g., widget w = button has property width = 120 and a number of events for isntance pressed.
(Functional) GUI Testing
- many applications has a GUI front-end, like cars, computers, phones, tablets
- It's the user's perspective: the topmost layer via whcih user interacts with the application.
- GUI Testing = testing the application from user's perspective: detecting real failures (both GUI and business logic ones).
Non-Functional GUI Testing:
- usability testing
A GUI Test Case: a sequence of events to be run consecutively on the GUI.
- E.g., press "window" menu, select "preferences" menu item, select "general", tick "always run in background" checkbox, type "10" in "workbench save internal" textbox, press "Apply and close".
Testing Approaches
1. Manual Testing: a human interacts with all different parts of the GUI to make sure the software works as expected.
- Pros: human is expert and has domain knowledge, human acts as an oracle
- Cons: error-prone, slow, costly.
2. Capture-then-Replay: capture the interactions of a user with the GUI, replay (automatically) the recorded sessions over and over.
- Capture-then-relay tools include: selenium, abbot, watir, autolt, etc. (free) and IBM robot tester, sahi, qf-test (commercial).
Selenium is an open-source GUI tester for web apps.
- Selenium IDE is a capture-then-replay (available as a plug-in for browsers, use as a prototyping tool)
- Web Driver is an automated test script (writing in different languages, runs in different browsers).
- "Selenium" is a well-known antidote for Mercury poisoning (which was a company that also made an automated testing framework).
- Selenium uses "Locators" like
$(byId(...))(CSS ID),$(byClassName(...))(CSS class name), ...- Use
idif there is a unique one, or else use css selector or xpath selector. Avoid selecting bytagname. See more best practices.
- Use
Summary
Use the "Page Object" Design Pattern
Linked from Software Testing and Debugging