Interacting with GUI
elements
1
Module Objectives
At the end of this module, you should be able to:
• Describe the usage of Radio buttons, dropdowns and checkboxes.
2
Topic List
#No Module Topics
1 Radio Buttons, Dropdowns and Checkboxes
3
Topic List
#No Module Topics
1 Radio Buttons, Dropdowns and Checkboxes
4
Interacting with GUI Elements- Radio Buttons(1)
Step1: Create a Testcase file named ‘[Link]’ within the path
C:\Cypress_Automation\cypress\integration\examples\[Link].
Step2: Create a describe block and specify the name of the “Testsuite”.
Step3: Within the describe block, create an it block and specify the name of the “Testcase”.
5
Interacting with GUI Elements- Radio Buttons(2)
Step4: Use keyword ‘[Link]’ to launch the web browser.
Step5: Use keyword ‘[Link]’ to locate the Register button using the css selector and perform the click()
operation.
Step6: Use keyword ‘[Link]’ to locate the radio button named gender, check if the button is visible , check
for the default status of the button, if not checked , perform the click operation as shown below in line no 8.
6
Interacting with GUI Elements- Checkbox(1)
Step7: Use keyword ‘[Link]’ to locate the checkbox named newsletter, check for the default status of the
checkbox, if it is checked, uncheck the box as shown below in line no 9 and 10 .
Note: The usage of checkbox can be changed according to the requirement of the application.
7
Interacting with GUI Elements- Dropdown(1)
Step8: Use keyword ‘[Link]’ to locate the dropdown named Date of birth, select the respective month, date
and year and add the validation as shown below in line no 11 and 12.
Note: The usage of dropdown can be changed according to the requirement of the application.
8
Interacting with GUI Elements
Step7: Save the changes
Step8: Open the test runner and execute the testcase.
9
Module Summary
Now, you should be able to:
• Describe the usage of Radio buttons, dropdowns and checkboxes.
10
Thank You
11