How to Handle Radio ButtonsĪ radio button is a toggle-button that allows you to check the operations. The keywords VerifyElementChecked and VerifyElementNotChecked are used to validate whether an element is checked or unchecked, respectively. In the script above, the keyword VerifyElementClickable is used to validate whether the Make Appointment Button is clickable. WebUI.click(findTestObject('Page_CURA Healthcare Service (2)/button_Book Appointment')) tText(findTestObject('Page_CURA Healthcare Service (2)/textarea_comment'), 'Katalon') WebUI.click(findTestObject('Page_CURA Healthcare Service (2)/td_3')) WebUI.click(findTestObject('Page_CURA Healthcare Service (2)/div_input-group-addon')) WebUI.click(findTestObject('Page_CURA Healthcare Service (2)/input_programs')) WebUI.verifyElementNotChecked(findTestObject('Page_CURA Healthcare Service (2)/input_hospital_readmission'), 30) 'Verify uncheck Hospital readmission check box' WebUI.uncheck(findTestObject('Page_CURA Healthcare Service (2)/input_hospital_readmission')) 'un check Hospital readmission check box' WebUI.verifyElementChecked(findTestObject('Page_CURA Healthcare Service (2)/input_hospital_readmission'), 30) 'verify Hospital readmission check box is checked' WebUI.check(findTestObject('Page_CURA Healthcare Service (2)/input_hospital_readmission')) lectOptionByValue(findTestObject('Page_CURA Healthcare Service (2)/select_facility'), 'Hongkong CURA Healthcare Center', 'Select the Hongkong CURA Healthcare Center from dropdown' WebUI.click(findTestObject('Page_CURA Healthcare Service (1)/button_Login')) WebUI.verifyElementClickable(findTestObject('Page_CURA Healthcare Service/a_Make Appointment')) Step 4: Make an appointment (check, uncheck the checkbox and verify check, uncheck status).
Step 3: Enter the valid username, password and click on Login button (verify the button and click operation).Step 2: Click on Make Appointment (verify the button and click operation).Step 1: Launch the application under test (URL: ).Username is a variable name, here storing the value “Katalon” in the username variable. In the script mode above, Def is a keyword in Groovy used for declaration of variables. WebUI.verifyMatch(userName, input_Value, false) 'verify the entered text and attribute value' Input_Value = WebUI.getAttribute(findTestObject('Page_CURA Healthcare Service (1)/input_username'), 'value') 'Get the attribute value of username text field' tText(findTestObject('Page_CURA Healthcare Service (1)/input_username'), userName) 'Decalre username variable and assign the value' WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Make Appointment')) Import internal.GlobalVariable as GlobalVariable Import .testobject.TestObject as TestObject Import .testobject.ObjectRepository as ObjectRepository Import .testdata.TestDataFactory as TestDataFactory Import .testcase.TestCaseFactory as TestCaseFactory
Import .model.FailureHandling as FailureHandling Import .checkpoint.CheckpointFactory as CheckpointFactory
Import .checkpoint.Checkpoint as Checkpoint
The reference source code is provided at the end of the tutorial. This tutorial illustrates how to handle test boxes, check boxes, radio buttons using Katalon Studio.