In a nutshell
The Set Value task enters a specified value directly into an input element on a webpage. This is used to populate fields such as a search box or a login form. The entered value is ready for the next step, whether that's submitting a search or confirming that the field contains the expected value. The task works with any text-based input, from a single search box to a full form with multiple fields.
The Set Value task populates a value into any text-based input element on a page. It's commonly used to automate scenarios such as entering a search query, filling out a login form, or typing a note into a checkout field. The task updates the fields directly, so it provides precise and predictable behavior in automated workflows.
Note: Set Value populates the field directly, without simulating individual keystrokes. For scenarios that depend on real keyboard input, such as triggering a live autocomplete suggestion, use Send Keys instead.setValue(<locator>, <value>);
| Parameter | Data Type | Description |
| locator | STRING | Identifies the text-based input element that receives the specified value. Note: Locators can be fetched in one of two ways, either by manually inspecting the webpage for the element, or by using an element already saved through a recording session. Learn more about Elements |
| value | STRING | Value to be set in the input element. |
Enters "Chrono 44" into the search box on the ZWatch Commerce home page using the Set Value task.
// Open the ZWatch Commerce home page using the Open URL task
openURL("https://zwatch.zohocommerce.com/", "same window");
// Enter a search query using the Set Value task
setValue("[data-search-input]", "Chrono 44");where:
| "https://zwatch.zohocommerce.com/" | ZWatch Commerce home page URL. |
| "same window" | Opens the page in the window already running the test. |
| [data-search-input] | Locator for the search box. |
| "Chrono 44" | Search term entered into the search box. |
// Open the login page using the Open URL task
openURL("<webpage_url>/login", "same window");
// Enter an invalid email format using the Set Value task
setValue(ui.login.email-field, "example#mail.con");
// Confirm the inline validation error appears using the Assert Visible task
assertVisible(ui.login.email-format-error, errorhandling.STOP_ON_ERROR);where:
| "<webpage_url>/login" | Login page URL. |
| "same window" | Opens the page in the window already running the test. |
| ui.login.email-field | Locator for the email field. |
| "example#mail.con" | Invalid email format entered into the field. |
| ui.login.email-format-error | Locator for the inline validation error. |
| errorhandling.STOP_ON_ERROR | Stops the test if the validation error doesn't appear. |
A short message is entered into the gift note field on a checkout page, using the Set Value task.
// Open the checkout page using the Open URL task
openURL("<webpage_url>/checkout", "same window");
// Enter a gift note using the Set Value task
setValue(ui.checkout.gift-note-field, "Happy Birthday!");where:
| "<webpage_url>/checkout" | Checkout page URL. |
| "same window" | Opens the page in the window already running the test. |
| ui.checkout.gift-note-field | Locator for the gift note field. |
| "Happy Birthday!" | Message entered into the gift note field. |
A candidate application form, built in Zoho Creator, has separate First Name and Last Name fields under the Candidate Name section. These fields are filled using the Set Value task.
// Open the candidate application form in the Recruitment Portal application using the Open URL task
openURL("https://creatorapp.zoho.com/<orgname>/recruitment-portal#Form:New_Application", "same window");
// Enter the candidate's first name using the Set Value task
setValue(ui.recruitmentportal.first-name-field, "Jordan");
// Enter the candidate's last name using the Set Value task
setValue(ui.recruitmentportal.last-name-field, "Lee");where:
| "https://creatorapp.zoho.com/<orgname>/recruitment-portal#Form:New_Application" | Candidate application form URL. |
| "same window" | Opens the form in the window already running the test. |
| ui.recruitmentportal.first-name-field | Locator for the First Name field. |
| "Jordan" | First name entered into the field. |
| ui.recruitmentportal.last-name-field | Locator for the Last Name field. |
| "Lee" | Last name entered into the field. |
Shoppers rely on search bar to quickly find a specific product rather than browsing the full catalog.
A tester uses Zoho QEngine to automate this validation. When the test case runs, it enters a search term into the search box and checks whether the results reflect that term. The validation will allow shoppers to search for a product and avoid seeing irrelevant or no results.
Steps
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: Enter a search term using the Set Value task
setValue("[data-search-input]", "Chrono 44");
// Step 3: Submit the search using the Send Keys task
sendKeys("[data-search-input]", [keys.ENTER]);
// Step 4: Confirm the results reflect the search term using the Assert Text task
assertText(".search-results-heading", "Results for Chrono 44", errorhandling.STOP_ON_ERROR);New customers create an account by filling out a signup form before they can check out with saved details.
A tester uses Zoho QEngine to automate this validation. When the test case runs, it fills out the signup fields and checks whether the account is created successfully. If the validation failed, new customers could be unable to sign up at all, blocking them from completing a purchase.
Steps
Implementation
// Step 1: Open the signup page in the same window using the Open URL task
openURL("<webpage_url>/signup", "same window");
// Step 2: Enter the customer's name using the Set Value task
setValue(ui.signup.name-field, "Jamie Rivera");
// Step 3: Enter the customer's email using the Set Value task
setValue(ui.signup.email-field, "jamie.rivera@example.com");
// Step 4: Enter a password using the Set Value task
setValue(ui.signup.password-field, "SecurePass123");
// Step 5: Submit the form using the Click task
click(ui.signup.submit-button);
// Step 6: Confirm the account is created using the Assert Visible task
assertVisible(ui.signup.account-created-message, errorhandling.STOP_ON_ERROR);Consider an organization that uses a Recruitment Portal application built on Zoho Creator to manage job applications. A recruiter reviewing a candidate's record sometimes needs to correct a detail, such as an outdated phone number, after the application was originally submitted.
A tester uses Zoho QEngine to automate this validation. When the test case runs, it opens the candidate's record from the Candidates report, edits the phone number field, and checks whether the update is saved. If the validation failed, a corrected phone number could appear to save successfully but silently revert, leaving the recruiter unable to reach the candidate.
Steps
Implementation
// Step 1: Open the Candidates report in the Recruitment Portal application using the Open URL task
openURL("https://creatorapp.zoho.com/<orgname>/recruitment-portal#Report:Candidates", "same window");
// Step 2: Click the candidate's row to open the record in Detail View using the Click task
click(ui.recruitmentportal.candidate-row);
// Step 3: Click Edit using the Click task
click(ui.recruitmentportal.edit-button);
// Step 4: Enter the updated phone number using the Set Value task
setValue(ui.recruitmentportal.phone-field, "9876543210");
// Step 5: Click Update using the Click task
click(ui.recruitmentportal.update-button);
// Step 6: Confirm the record reflects the updated phone number using the Assert Text task
assertText(ui.recruitmentportal.phone-field, "9876543210", errorhandling.STOP_ON_ERROR);Before using the Set Value task, ensure that you've learned how to interact with an element using the Click task.