In a nutshell
The Check task automates checking a checkbox on a webpage. It performs the same action as a user clicking the checkbox to mark it as selected. This lets your test confirm choices that depend on a checked state, such as accepting terms and conditions before an account can be created.
The Check task sets a checkbox on a web page to its checked state. It's used to automate interactions with checkbox controls representing binary choices, such as accepting terms and conditions or applying an optional discount during checkout. This also extends to default toggle switches, since these are typically built on a checkbox element underneath.
This task is useful for validating workflows where checking a box can change the application's behavior, unlock additional actions, or save a user's preference, rather than simply changing the visual state of the checkbox.
Note: The Select and Check tasks are two distinct actions that serve different purposes when interacting with web elements. The Select task focuses on setting a value to a dropdown field, while the Check task interacts with the checkbox.check(<locator>);
| Parameter | Data Type | Description |
| locator | STRING | Locator that identifies the checkbox on the webpage. Note: Locators can be fetched in one of two ways, either by manually inspecting the webpage to identify the element, or by using a recorded element saved during a recording session. Learn more about Elements |
Checks the discount checkbox on the ZWatch Commerce checkout page so the discount is applied to the order total.
// Open the checkout page on the ZWatch Commerce website using the Open URL task
openURL("https://zwatch.zohocommerce.com/checkout", "same window");
// Check the discount checkbox using the Check task
check(ui.zwatch.GMT.discount);where:
| "https://zwatch.zohocommerce.com/checkout" | Checkout page URL. |
| "same window" | Opens the page in the window already running the test. |
| ui.zwatch.GMT.discount | Stored locator for the discount checkbox. |
A signup form requires the terms and conditions checkbox to be checked before the Create Account button becomes enabled.
// Open the account signup page on the ZWatch Commerce website using the Open URL task
openURL("https://zwatch.zohocommerce.com/signup", "same window");
// Check the terms and conditions checkbox using the Check task
check(ui.zwatch.terms-checkbox);
// Confirm the Create Account button is enabled using the Assert Visible task
assertVisible(ui.zwatch.create-account-button, errorhandling.STOP_ON_ERROR);
// Click the Create Account button using the Click task
click(ui.zwatch.create-account-button);where:
| "https://zwatch.zohocommerce.com/signup" | Account signup page URL. |
| "same window" | Opens the page in the window already running the test. |
| ui.zwatch.terms-checkbox | Stored locator for the terms and conditions checkbox. |
| ui.zwatch.create-account-button | Stored locator for the Create Account button. |
Checks the Terms Accepted checkbox on a vendor registration form, built on Zoho Creator, using the Check task.
// Open the vendor registration form in the Vendor Compass application using the Open URL task
openURL("https://creatorapp.zoho.com/zylker/vendor-compass#Form:Vendor_Registration", "same window");
// Check the Terms Accepted checkbox using the Check task
check(ui.vendorcompass.terms-accepted-checkbox);where:
| "https://creatorapp.zoho.com/zylker/vendor-compass#Form:Vendor_Registration" | Vendor registration form URL. |
| "same window" | Opens the form in the window already running the test. |
| ui.vendorcompass.terms-accepted-checkbox | Stored locator for the Terms Accepted checkbox on the form. |
Online stores often offer a "save my details" option at checkout, so returning customers don't have to retype their shipping address on their next order. This only works if checking that box during checkout actually persists the customer's details for their next visit.
Zoho QEngine automates a check of this workflow. It checks the save-details checkbox during checkout, returns to the checkout page, and verifies the shipping address is pre-filled. If the checkbox failed to save anything, returning customers would have to re-enter their details every time, undermining the whole point of the feature.
Implementation
// Step 1: Open the checkout page on the ZWatch Commerce website in the same window using the Open URL task
openURL("https://zwatch.zohocommerce.com/checkout", "same window");
// Step 2: Check the save-details checkbox using the Check task
check(ui.zwatch.save-details-checkbox);
// Step 3: Complete the order using the Click task
click(ui.zwatch.place-order-button);
// Step 4: Reopen the checkout page using the Open URL task
openURL("https://zwatch.zohocommerce.com/checkout", "same window");
// Step 5: Confirm the shipping address field is pre-filled using the Assert Text task
assertText(ui.zwatch.shipping-address-field, "221B Baker Street", errorhandling.STOP_ON_ERROR);Retail apps often let customers manage how they're contacted from an account settings page. This includes a checkbox to enable order updates by SMS instead of, or alongside, email. The setting needs to persist after the customer saves it, not just appear checked until the page is reloaded.
Zoho QEngine automates a check of whether this setting actually sticks. It checks the SMS notifications checkbox, saves the settings, then reloads the page to confirm the checkbox is still checked. If the setting silently failed to save, customers who opted in would never receive the SMS updates they signed up for.
Implementation
// Step 1: Open the account settings page on the ZWatch Commerce website in the same window using the Open URL task
openURL("https://zwatch.zohocommerce.com/account/settings", "same window");
// Step 2: Check the SMS notifications checkbox using the Check task
check(ui.zwatch.sms-notifications-checkbox);
// Step 3: Save the settings using the Click task
click(ui.zwatch.save-settings-button);
// Step 4: Reload the account settings page using the Open URL task
openURL("https://zwatch.zohocommerce.com/account/settings", "same window");
// Step 5: Confirm the SMS notifications checkbox remains checked using the Assert Visible task
assertVisible(ui.zwatch.sms-notifications-checkbox-checked, errorhandling.STOP_ON_ERROR);Consider a retail organization that uses a Zoho Creator Inventory Management application to manage stock replenishment. A warehouse manager enables automatic reordering for a product by selecting the Auto Reorder checkbox on the Product form. When this option is enabled, the application automatically creates a purchase order whenever the product's stock falls below the configured reorder level.
A tester uses Zoho QEngine to verify that the Auto Reorder option is saved correctly. If the option isn't persisted, purchase orders won't be generated automatically when stock reaches the reorder level, leading to stock shortages.
Implementation
// Step 1: Open the Product form in the Inventory Management application using the Open URL task
openURL("https://creatorapp.zoho.com/zylker/inventory-manager#Form:Product_Settings", "same window");
// Step 2: Select the Auto Reorder checkbox using the Check task
check(ui.inventorymanager.auto-reorder-checkbox);
// Step 3: Save the settings using the Click task
click(ui.inventorymanager.save-button);
// Step 4: Confirm the Auto Reorder checkbox remains checked after saving using the Assert Visible task
assertVisible(ui.inventorymanager.auto-reorder-confirmed-icon, errorhandling.STOP_ON_ERROR);