Note: These tasks are used for web test cases.
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. Applicable values:
Note: When the test case is recorded the default window type selected would be "same window". |
where:
"https://zwatch.com" | URL of the website that needs to be opened. |
"same window" | This represents that the URL needs to be opened in the same window. |
Example 2: In the previous example, say, the URL was stored inside a <variable> named URL. Use the following script to open the stored URL.
where:
$URL | The variable that stores the value of the URL to be opened. |
"new window" | The URL needs to be opened in the new window. |
Parameter | Data Type | Description |
<locator> | STRING | Address to locate the element you need to click on Note: You can inspect from the webpage to find the locators of the elements or record and store the elements. Learn more about Elements. |
"https://www.zwatch.com" | URL of the website that needs to be opened. |
"same window" | This represents that the URL needs to be opened in the same window. |
"//span[text()='Add to Cart']" | This indicates the xpath of the element "Add to Cart" button. Here, the '//' is used to select the current node of the xpath, which is 'span' in this case. The '[ ]' is used to enclose the attribute name and its value. |
"https://www.zwatch.com" | URL of the website that needs to be opened. |
ui.guest_shopping.add_to_cart_button | The recorded locator of the element "Add to Cart" button. |
Parameter | Data Type | Description |
<locator> | STRING | Address to locate the input element. Note: You can inspect from the webpage to find the locators of the elements or record and store the elements. Learn more about Elements. |
<value> | STRING | Value to be set in the input element. |
"https://www.zwatch.com" | URL of the website that needs to be opened. |
"same window" | This represents that the URL needs to be opened in the same window. |
"#login_id" | The locator of the element "username field" of the login form. Here, the '#' is used to refer to the ID of the element. |
$Username | The variable where the username value is stored. Learn more about Variables. |
The task verifies whether a specific text is present within the web element of the webpage.
Parameter | Data Type | Description |
<locator> | STRING | Address to locate the element that should contain the expected text.
Note: You can inspect from the webpage to find the locators of the elements or record and store the elements. Learn more about Elements. |
<text> | STRING | Text you expect to find in the element. |
<errorHandling> | STRING | If the verification fails, it returns a false response, as the element mismatches with the actual element. For such scenarios, choose how the consequent test scripts should behave:
|
"https://www.zwatch.com | URL of the website that needs to be opened. |
"same window" | This represents that the URL needs to be opened in the same window. |
ui.welcome_message.h3 | The stored locator of the element that displays the welcome message. |
"Welcome to Zylker Watches!" | The welcome message text that needs to be displayed. |
errorhandling.STOP_ON_ERROR | This error handling behaviour stops the execution of the test case, if the message isn't displayed. |
Parameter | Data Type | Description |
<locator> | STRING | Address to locate the element that should contain the value. Note: You can inspect from the webpage to find the locators of the elements or record and store the elements. Learn more about Elements. |
<value> | STRING | Value you expect to find in the element. |
<errorHandling> | STRING | If the verification fails, it returns a false response, as the element mismatches with the actual element. For such scenarios, choose how the consequent test scripts should behave:
|
"https://www.zwatch.com" | URL of the website that needs to be opened. |
"same window" | This represents that the URL needs to be opened in the same window. |
#userName | The locator of the element |
Chris | The name that has to be verified |
errorhandling.STOP_ON_ERROR | This error handling behaviour stops the execution of the test case, on not finding the expected value. |
wait(<time>);
Parameter | Data Type | Description |
<time> | LONG | Duration to wait in seconds. |
wait(<time>,<locator>,<event>);
Parameter | Data Type | Description |
<time> | LONG | Duration to wait for the element in seconds. The maximum time you can specify in a wait task is 150s. |
<locator>
| STRING | Address to locate the element based on which the wait condition should be applied.
Note: You can inspect from the webpage to find the locators of the elements or record and store the elements. Learn more about Elements. |
<event>
| STRING | An event defines the specific waiting condition for the element. The 'Wait Task' will pause its execution until the specified event occurs. The supported events for the element:
|
where:
5 | Specifying the time in seconds, for the element to wait. |
"https://www.zwatch.com" | URL of the website that needs to be opened. |
"same window" | This represents that the URL needs to be opened in the same window. |
10 | Specifying the time in seconds, for the element to wait. |
"//lyte-search[@id='elementGroupSearch']//input" | This determines the locator of the element you want to wait for. Here, the '//' is used to select the current node of the xpath, which is 'lyte-search' in this case. The '[ ]' is used to enclose the attribute name and its value. |
event.SHOW | This event waits for the element which is visible in the DOM. |