Checkboxes and Radio Buttons | Bondar Academy
Course: AI-based testing with testRigor
Module: Interation with Web Elements
Instructor: Artem Bondar
Lesson Summary
In this lesson, we explore how to interact with checkboxes and radio buttons , as well as how to assert their statuses. We will automate functionality on the Toaster page of our test application. Checkbox Interaction We begin by navigating to the Toaster page, which contains three checkboxes. Here’s how to automate checkbox interactions: To uncheck a checkbox, use the Click command: Click checkbox HideOnClick To validate the checkbox status, use: CheckThat checkbox HideOnClick is not checked To check a checkbox, use: Enter one into checkbox HideOnClick To uncheck a checkbox regardless of its current state, use: Enter zero into checkbox HideOnClick Assertions can be made to confirm the checkbox state after actions. Radio Button Interaction Radio buttons allow selection of only one option at a time. To automate radio button interactions: Use the Click command for selection: Click radio button option one Validate the selected state with: Check that radio button option one is checked When selecting a different option, ensure the previous option is deselected. Summary To summarize: Use Click to toggle checkbox states. Use Enter zero or Enter one to set specific states. Radio buttons require a click for selection and can be validated similarly. Relative locators can be used for non-unique elements. That's all for this lesson!