Uncheck task | Zoho QEngine Help

Uncheck task

In a nutshell

The Uncheck task sets a checked checkbox back to its unchecked state. This lets your test validate workflows that depend on a checkbox being cleared, such as disabling notifications or removing a previously selected preference.

1. Overview

The Uncheck task clears a checkbox that is currently selected, returning it to its unchecked state. It is used to validate how an application behaves when a user reverses a previous choice or disables an option they had previously enabled.
Beyond confirming that the checkbox is visually cleared, this task verifies that the application correctly updates its state and any dependent functionality affected by the change. This ensures that the system responds appropriately when a previously enabled option is removed. For example, a customer disabling notifications so a confirmation email no longer arrives for future orders.

This task also applies to toggle switches that are implemented using checkbox elements. Although these controls may appear visually different, the underlying interaction is the same because clearing the selected state is expected to trigger the corresponding application behavior.
NotesNote: The Deselect and Uncheck tasks are two distinct actions that serve different purposes when interacting with web elements. The Deselect task focuses on deselecting the currently selected value from a dropdown field, while the Uncheck task interacts with the checkbox.

2. Syntax

uncheck(<locator>);


ParameterData TypeDescription
locatorSTRINGIdentifies the checkbox on the webpage.
NotesNote: 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

3. Examples

Example 1: Removing an applied loyalty discount before checkout

Unchecks the loyalty discount checkbox on the ZWatch Commerce checkout page so the discount no longer applies 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");
// Uncheck the loyalty discount checkbox using the Uncheck task
uncheck(ui.zwatch.loyalty-discount-checkbox);

where:


"https://zwatch.zohocommerce.com/checkout"Checkout page URL.
"same window"Opens the page in the window already running the test.
ui.zwatch.loyalty-discount-checkboxStored locator for the loyalty discount checkbox.

Example 2: Unchecking "keep me signed in" on a login page

Unchecks the "keep me signed in" checkbox on the login page, then confirms the checkbox is no longer checked.

// Open the login page on the ZWatch Commerce website using the Open URL task
openURL("https://zwatch.zohocommerce.com/login", "same window");
// Uncheck the keep me signed in checkbox using the Uncheck task
uncheck(ui.zwatch.keep-signed-in-checkbox);
// Confirm the checkbox is no longer checked using the Assert Selected task
assertSelected(ui.zwatch.keep-signed-in-checkbox, errorhandling.CONTINUE_ON_ERROR);

where:


"https://zwatch.zohocommerce.com/login"Login page URL.
"same window"Opens the page in the window already running the test.
ui.zwatch.keep-signed-in-checkboxStored locator for the "keep me signed in" checkbox.
errorhandling.CONTINUE_ON_ERRORContinues the test and returns the result instead of stopping if the checkbox still shows as checked.

Example 3: Clearing the Auto Reorder checkbox while editing a product record

Clears the Auto Reorder checkbox while editing a product record in the Inventory Manager application, built on Zoho Creator, using the Uncheck task.

// Open the product record in the Inventory Manager application using the Open URL task
openURL("https://creatorapp.zoho.com/zylker/inventory-manager#Form:Product_Record", "same window");
// Clear the Auto Reorder checkbox using the Uncheck task
uncheck(ui.inventorymanager.auto-reorder-checkbox);

where:


"https://creatorapp.zoho.com/zylker/inventory-manager#Form:Product_Record"Product record form URL.
"same window"Opens the form in the window already running the test.
ui.inventorymanager.auto-reorder-checkboxStored locator for the Auto Reorder checkbox.

4. Use cases

Scenario 1: Removing a gift wrap option before finalizing an order

Online stores sometimes let customers add gift wrapping during checkout, then change their mind before placing the order. If unchecking the gift wrap option doesn't actually remove it, the customer could be charged for a service they no longer want.

A tester uses Zoho QEngine to verify that removing the gift wrap option updates the order total correctly. If that check failed, the customer would be charged for gift wrapping they explicitly opted out of.


Steps
  1. Open the checkout page in the same window.
  2. Check the gift wrap checkbox.
  3. Uncheck the gift wrap checkbox.
  4. Confirm the order total no longer includes the gift wrap fee.

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 gift wrap checkbox using the Check task
check(ui.zwatch.gift-wrap-checkbox);
// Step 3: Uncheck the gift wrap checkbox using the Uncheck task
uncheck(ui.zwatch.gift-wrap-checkbox);
// Step 4: Confirm the order total excludes the gift wrap fee using the Assert Text task
assertText(ui.zwatch.order-total, "$75.00", errorhandling.STOP_ON_ERROR);

Scenario 2: Disabling saved payment details on a shared computer

Retail sites often let customers save their payment method for faster future checkouts, but that convenience becomes a security risk on a shared or public computer. Customers need a reliable way to turn this off before stepping away.

A tester uses Zoho QEngine to verify that clearing the setting properly removes the stored payment information. If disabling the option did not take effect, a subsequent user of the same computer could potentially make purchases using another customer's payment details.


Steps
  1. Open the account settings page in the same window.
  2. Uncheck the save payment method checkbox.
  3. Confirm no payment method remains saved.

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: Uncheck the save payment method checkbox using the Uncheck task
uncheck(ui.zwatch.save-payment-checkbox);
// Step 3: Confirm no payment method remains saved using the Assert Not Present task
assertNotPresent(ui.zwatch.saved-payment-method, errorhandling.STOP_ON_ERROR);

Scenario 3: Removing manager approval requirement from an onboarding task

Consider an HR organization that uses a Zoho Creator Onboarding application to manage new hire tasks. Each onboarding task is stored as a record in the Onboarding Tasks form. While some tasks require manager approval, HR staff can remove this requirement for specific roles by clearing the Requires Manager Approval checkbox before saving the record.

A tester uses Zoho QEngine to verify that clearing the Requires Manager Approval checkbox updates the task correctly. If the change is not saved, onboarding tasks for exempt employees could remain pending for an approval that is not required.


Steps
  1. Open the Onboarding Tasks form in the Onboarding application.
  2. Uncheck the Requires Manager Approval checkbox.
  3. Save the record.
  4. Confirm the checkbox remains unchecked after the record is saved.

Implementation

// Step 1: Open the Onboarding Tasks form in the Onboarding application using the Open URL task
openURL("https://creatorapp.zoho.com/zylker/onboarding#Form:Onboarding_Tasks", "same window");
// Step 2: Uncheck the Requires Manager Approval checkbox using the Uncheck task
uncheck(ui.onboarding.manager-approval-checkbox);
// Step 3: Save the record using the Click task
click(ui.onboarding.save-button);
// Step 4: Confirm the checkbox remains unchecked after saving using the Assert Selected task
assertSelected(ui.onboarding.manager-approval-checkbox, errorhandling.STOP_ON_ERROR);

5. Points to note

  1. Use the Uncheck task only to clear a checkbox that is already checked, it doesn't act on a dropdown's selected value. Use Deselect for that instead.
  2. When a checkbox doesn't have a clear label of its own, prefer a locator built from its name or id attribute over a raw full XPath string, since checkboxes are often grouped tightly together with other options nearby.
  1. Check
  2. Select
  3. Deselect
  4. Clear
  5. Upload

7. What's next

Next step
Previous step
Next step

Now that you've used the Uncheck task to remove a checked state, learn how to clear an input field's value using the Clear task.


Previous step

Before using the Uncheck task, learn how to use the Check task to select a checkbox.