In a nutshell
The Right Click task performs a right-click on a web element during test execution. It's used to trigger context-specific interactions, such as opening a row's actions menu in a results table.
rightClick(<locator>);
| Parameter | Data Type | Description |
| locator | STRING | Identifies the element to right-click. Note: Locators can be found by manually inspecting the webpage for the element, or by using an element already saved through a recording session. Learn more about Elements |
Search for a product, then right-click the results heading to open a custom share-results context menu.
// Open the ZWatch Commerce home page using the Open URL task
openURL("https://zwatch.zohocommerce.com/", "same window");
// Click the search icon to reveal the search input using the Click task
click(".theme-search");
// Enter a search term using the Set Value task
setValue("[data-search-input]", "Chrono 44");
// Submit the search using the <Send Keys> task
sendKeys("[data-search-input]", [keys.ENTER]);
// Right-click the results heading using the Right Click task
rightClick(".search-results-heading");
// Confirm the share-results context menu appears using the Assert Visible task
assertVisible(ui.zwatch.share-results-menu, errorhandling.STOP_ON_ERROR);where:
| "https://zwatch.zohocommerce.com/" | ZWatch Commerce home page URL. |
| "same window" | Opens the page in the window already running the test. |
| .theme-search | Locator for the search icon. |
| [data-search-input] | Locator for the search box. |
| "Chrono 44" | Search term entered into the search box. |
| .search-results-heading | Locator for the results heading |
| ui.zwatch.share-results-menu | Locator for the share-results context menu. |
| errorhandling.STOP_ON_ERROR | Stops the test if the share-results context menu doesn't appear. |
Right-click a row in a data table to open its row-level actions menu.
// Open the ZWatch Commerce home page using the Open URL task
openURL("https://zwatch.zohocommerce.com/", "same window");
// Click the search icon to reveal the search input using the Click task
click(".theme-search");
// Enter a search term using the Set Value task
setValue("[data-search-input]", "Chrono 44");
// Submit the search using the <Send Keys> task
sendKeys("[data-search-input]", [keys.ENTER]);
// Right-click the first search result row using the Right Click task
rightClick(ui.zwatch.search-result-row);
// Confirm the row actions menu appears using the Assert Visible task
assertVisible(ui.zwatch.row-actions-menu, errorhandling.STOP_ON_ERROR);
// Select Add to Compare from the actions menu using the Click task
click(ui.zwatch.row-actions-add-to-compare);
// Confirm that the comparison bar reflects the added item using the Assert Visible task
assertVisible(ui.zwatch.compare-bar, errorhandling.STOP_ON_ERROR);where:
| "https://zwatch.zohocommerce.com/" | ZWatch Commerce home page URL. |
| "same window" | Opens the page in the window already running the test. |
| .theme-search | Locator for the search icon. |
| [data-search-input] | Locator for the search box. |
| "Chrono 44" | Search term entered into the search box. |
| ui.zwatch.search-result-row | Locator for the first search result row. |
| ui.zwatch.row-actions-menu | Locator for the row actions menu. |
| errorhandling.STOP_ON_ERROR | Stops the test if the row actions menu doesn't appear. |
| ui.zwatch.row-actions-add-to-compare | Locator for the Add to Compare option in the actions menu. |
| ui.zwatch.compare-bar | Locator for the comparison bar reflecting the added item. |
Right-click a lease record row in a Zoho Creator Lease Tracker application to open its actions menu.
// Open the Leases report in the Lease Tracker application using the Open URL task
openURL("https://creatorapp.zoho.com/orgname/lease-tracker#Report:Leases", "same window");
// Right-click the lease record row using the Right Click task
rightClick(ui.leasetracker.lease-record-row);
// Confirm the record actions menu appears using the Assert Visible task
assertVisible(ui.leasetracker.record-actions-menu, errorhandling.STOP_ON_ERROR);where:
| "https://creatorapp.zoho.com/orgname/lease-tracker#Report:Leases" | Leases report URL. |
| "same window" | Opens the report in the window already running the test. |
| ui.leasetracker.lease-record-row | Locator for the lease record row. |
| ui.leasetracker.record-actions-menu | Locator for the record actions menu. |
| errorhandling.STOP_ON_ERROR | Stops the test if the record actions menu doesn't appear. |
Shoppers viewing a product photo might want to share it directly rather than saving and re-uploading it elsewhere, and the product page offers this through its own right-click menu rather than the browser's built-in options.
A tester uses Zoho QEngine to right-click the image, select Share from the custom menu, and confirm the share panel appears, ensuring the sharing shortcut works as intended.
Implementation
// Step 1: Open the Diver Chronomat product page on the ZWatch Commerce website in the same window using the Open URL task
openURL("https://zwatch.zohocommerce.com/products/diver-chronomat/3531661000000075722", "same window");
// Step 2: Wait until the product image becomes clickable
wait(10, "img[alt='Diver Chronomat']", event.CLICKABLE);
// Step 3: Right-click the product image using the Right Click task
rightClick("img[alt='Diver Chronomat']");
// Step 4: Select the Share option from the context menu using the Click task
click(ui.zwatch.image-context-menu-share-option);
// Step 5: Confirm the share panel appears using the Assert Visible task
assertVisible(ui.zwatch.share-panel, errorhandling.STOP_ON_ERROR);A tester uses Zoho QEngine to search for Chrono 44, right-click the result row, select Add to Wishlist, and confirm the item was saved, giving shoppers a quick way to bookmark a product while browsing search results.
Implementation
// Step 1: Open the ZWatch Commerce home page in the same window using the Open URL task
openURL("https://zwatch.zohocommerce.com/", "same window");
// Step 2: Click the search icon to reveal the search input using the Click task
click(".theme-search");
// Step 3: Enter a search term using the Set Value task
setValue("[data-search-input]", "Chrono 44");
// Step 4: Submit the search using the <Send Keys> task
sendKeys("[data-search-input]", [keys.ENTER]);
// Step 5: Right-click the first search result row using the Right Click task
rightClick(ui.zwatch.search-result-row);
// Step 6: Select Add to Wishlist from the actions menu using the Click task
click(ui.zwatch.row-actions-add-to-wishlist);
// Step 7: Confirm the wishlist confirmation message appears using the Assert Visible task
assertVisible(".wishlist-selection-container", errorhandling.STOP_ON_ERROR);Consider a retail organization that uses a Zoho Creator Inventory Manager application to track stock. Warehouse staff right-click a product row in the Inventory report to open a quick actions menu, then choose Flag for Reorder rather than opening the full record to change its status manually. This menu is a Custom Action configured on the report, which runs a Deluge script to update the item's reorder status field.
A tester uses Zoho QEngine to right-click a record row, select Flag for Reorder from the menu, reopen the report, and confirm the reorder status was saved, ensuring low-stock items are reliably flagged for restocking.
Implementation
// Step 1: Open the Inventory report in the Inventory Manager application using the Open URL task
openURL("https://creatorapp.zoho.com/<orgname>/inventory-manager#Report:Inventory", "same window");
// Step 2: Wait until the record row is present on the page
wait(10, ui.inventorymanager.record-row, event.PRESENT);
// Step 3: Right-click the record row using the Right Click task
rightClick(ui.inventorymanager.record-row);
// Step 4: Select Flag for Reorder from the actions menu using the Click task
click(ui.inventorymanager.flag-for-reorder-option);
// Step 5: Reopen the Inventory report using the Open URL task
openURL("https://creatorapp.zoho.com/<orgname>/inventory-manager#Report:Inventory", "same window");
// Step 6: Confirm the record's reorder status reflects the change using the Assert Text task
assertText(ui.inventorymanager.reorder-status-field, "Flagged", errorhandling.STOP_ON_ERROR);Now that you've learned how to right-click an element using the Right Click task, learn how to hover over an element using the Hover task.
Before learning about the Right Click task, ensure you have learned how to perform a double-click on an element using the Double Click task.