In a nutshell
The Open URL task loads a specified URL in the browser, allowing your test to start from a specific page or navigate to another page during execution. The URL can be given directly as a string or stored in a variable, and opened in the same window, a new tab, or a new window depending on the test's requirement.
Note: QEngine launches a separate browser session to run the test, distinct from the browser you use to build the test case. This session may be visible or headless depending on your run configurationsopenURL(<URL>, <window_type>);
| Parameter | Data Type | Description |
| URL | STRING | URL of the website that will be opened. ![]() Note:
|
| window_type | STRING | The type of window in which the URL will be opened. new window - Directs the URL to a browser window separate from the current one. Note: When a test case is recorded, the default window type selected is "same window." |
Example 1: Opening the home page and signing in
This script opens the Zylker Watches home page in the same window, followed by a click on the Sign In link to reach the login page.
// Step 1: Open the Zylker Watches home page on the ZWatch Commerce website in the same window
openURL("https://zwatch.zohocommerce.com/", "same window");
// Step 2: Click the Sign In link using the Click task
click("a[href='/signin']");where:
| "https://zwatch.zohocommerce.com/" | URL of the Zylker Watches home page on the ZWatch Commerce website. |
| "same window" | Opens the home page in the window already running the test. |
| "a[href='/signin']" | Locator for the Sign In link on the home page. |
// Step 1: Open the Diver Chronomat product page on the ZWatch Commerce website in the same window
openURL("https://zwatch.zohocommerce.com/products/diver-chronomat/3531661000000075722", "same window");
// Step 2: Open the Daytona product page in a new tab, leaving the Diver Chronomat tab open
openURL("https://zwatch.zohocommerce.com/products/daytona/3531661000000075692", "new tab");
// Step 3: daytonaPrice stores the price text read from the Daytona page using the Get Text task
daytonaPrice = getText("span[data-zs-selling-price]");
// Step 4: Switch back to the Diver Chronomat tab using the Switch To task
switchTo(ui.zwatch.diver-chronomat-tab);
// Step 5: Confirm the Diver Chronomat price differs from the stored Daytona price using the Assert Text task
assertText("span[data-zs-selling-price]", daytonaPrice, errorhandling.CONTINUE_ON_ERROR);where:
| "https://zwatch.zohocommerce.com/products/diver-chronomat/3531661000000075722" | URL of the Diver Chronomat product page. |
| "same window" | Opens the Diver Chronomat page in the window already running the test. |
| "https://zwatch.zohocommerce.com/products/daytona/3531661000000075692" | URL of the Daytona product page. |
| "new tab" | Opens the Daytona page in a new tab, leaving the Diver Chronomat tab open. |
| daytonaPrice | Variable storing the price text read from the Daytona page. |
| span[data-zs-selling-price] | Locator pattern for the selling price element on a ZWatch Commerce product page. |
| ui.zwatch.diver-chronomat-tab | Stored reference for the tab holding the Diver Chronomat page. |
| errorhandling.CONTINUE_ON_ERROR | Continues the test and returns the comparison result instead of stopping if the prices don't differ. |
// Step 1: productURL holds the URL returned by the shopping module's get_product_url function
productURL = shopping.get_product_url("daytona");
// Step 2: Open the returned URL in a new window
openURL(productURL, "new window");where:
| productURL | Variable storing the URL returned by the shopping module's get_product_url function. |
| shopping.get_product_url("daytona") | Function call that returns the constructed URL for the Daytona product page. |
| "new window" | Opens the returned URL in a separate browser window. |
// Step 1: Open the Pending Vendor Requests report in the Vendor Compass application
openURL("https://creatorapp.zoho.com/zylker/vendor-compass#Report:Pending_Vendor_Requests", "same window");
// Step 2: Approve the pending vendor request using the Click task
click(ui.vendorcompass.approve-button);where:
| "https://creatorapp.zoho.com/zylker/vendor-compass#Report:Pending_Vendor_Requests" | URL of the Pending Vendor Requests report in the Vendor Compass application. |
| "same window" | Opens the report in the window already running the test. |
| ui.vendorcompass.approve-button | Stored locator for the approve control on the report. |
Scenario 1: Starting a checkout test from an already-authenticated session
Online stores that support persistent login expect returning customers to move straight into checkout without logging in again, as long as their session is still valid.
A tester needs to confirm this experience holds up. The test opens the store, restores a session captured during an earlier login test using Set Cookie, and proceeds directly to checkout. If session restoration failed silently, the customer would be forced through a full login again, adding friction that could cause cart abandonment.
Steps
Implementation
// Step 1: Open the Zylker Watches home page on the ZWatch Commerce website in the same window
openURL("https://zwatch.zohocommerce.com/", "same window");
// Step 2: savedSession holds the cookie values captured during an earlier login test, reused here to skip logging in again
savedSession = "authToken=98213xyz; sessionid=xyz789";
// Step 3: Restore the saved session into the browser using the Set Cookie task
setCookies("zwatch.zohocommerce.com", "savedSession");
// Step 4: Navigate to the Diver Chronomat product page using the Click task
click("a[href*='diver-chronomat']");
// Step 5: Add the product to the cart using the Click task
click(".theme-product-qty-and-add-cart");Scenario 2: Comparing two product prices side by side
Shoppers comparing similar watch models often want two product pages open at once, without losing their place on the page they started on.
A tester needs to confirm this comparison workflow holds up: opening a second product in a new tab while the original stays open, then verifying the two prices actually differ. If opening a new tab instead replaced or lost the original page, comparison shopping would break for the customer.
Steps
Implementation
// Step 1: Open the Diver Chronomat product page on the ZWatch Commerce website in the same window
openURL("https://zwatch.zohocommerce.com/products/diver-chronomat/3531661000000075722", "same window");
// Step 2: Open the Daytona product page in a new tab, leaving the Diver Chronomat tab open
openURL("https://zwatch.zohocommerce.com/products/daytona/3531661000000075692", "new tab");
// Step 3: daytonaPrice stores the price text read from the Daytona page using the Get Text task
daytonaPrice = getText("span[data-zs-selling-price]");
// Step 4: Switch back to the Diver Chronomat tab, since the Daytona tab became active when it opened
switchTo(ui.zwatch.diver-chronomat-tab);
// Step 5: Confirm the Diver Chronomat price differs from the stored Daytona price using the Assert Text task
assertText("span[data-zs-selling-price]", daytonaPrice, errorhandling.CONTINUE_ON_ERROR);Scenario 3: Reviewing customer history without losing an open work order
A field service organization uses a Zoho Creator Field Service Management application to manage customer work orders, assign technicians, and track service history. Before assigning a technician to a new work order, support staff review the customer's previous service visits to understand recurring issues, warranty status, and past maintenance records.
A tester uses Zoho QEngine to automate this validation. The test confirms that opening the customer history dashboard in a new window lets the tester review service history without interrupting or losing the work order already open in the original window, then returns to that window to continue processing the request.
Steps
Implementation
// Step 1: Open the Work Order form in the Zoho Creator Field Service Management application
openURL("https://creatorapp.zoho.com/zylker/field-service-management#Form:Work_Order", "same window");
// Step 2: Open the Customer History dashboard in a new browser window
openURL("https://creatorapp.zoho.com/zylker/field-service-management#Page:Customer_History", "new window");
// Step 3: Switch back to the original browser window
switchTo(ui.fieldservice.work-order-window);
// Step 4: Continue processing the work order
click(ui.fieldservice.assign-technician);Previous step
Before using the Open URL task, ensure that you've created your test case and understand what <web testing> is in QEngine.
Now that you've used the Open URL task to navigate to a URL, learn how to interact with an element on the page using the Click task.