Parameter | Data Type | Description |
<variable> | STRING
| Variable to store the text value of the element. This value can be a visible text data from webpages. |
<locator> | STRING | Address to locate the element from which the text should be retrieved.
Note: The value to this parameter can either be supplied with recorded locators stored as elements or hard coded with the necessary locators in the format "<locator>". Learn more. |
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. |
currencyType | The variable that stores the currency type chosen by the user. The user can choose between "INR" and "USD". |
"li[data-theme-base-currency]" | The inspected locator of the dropdown that contains the currency type on the website. |
"//span[@data-zs-selling-price='30000.0']" | The inspected locator of the element that contains the currency text that has to be displayed. |
"Rs.30,000.00" | The text visible in the product description, if the currency type chosen is "INR". |
errorhandling.STOP_ON_ERROR | This error handling behaviour stops the execution of the test case, if the currency isn't displayed correctly. |
"$360.84" | The text visible in the product description, if the currency type chosen is "USD". |
<variable> = getAttribute(<locator>, <attribute>);
Parameter | Data Type | Description |
<variable> | STRING | Variable to store the attribute value of the element. |
<locator> | STRING | Address to locate the element whose attribute value has to be fetched.
Note: The value to this parameter can either be supplied with recorded locators stored as elements or hard coded with the necessary locators in the format "<locator>". Learn more. |
<attribute> | STRING | Name of the attribute whose value needs to be fetched. Specify the type of attribute, as "<attribute>". |
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. |
altTextCheck | The variable that stores the text fetched from the alt attribute of the product's image. |
//img[@class='zpimage zpimage-style-none zpimage-space-none '] | The inspected locator of the product image. |
"alt" | The attribute from which the text value has to be fetched from. |
"Incorrect alt text" | The message that has to be displayed if the text fetched from the alt attribute matches with the expected text. |
Parameter | Data Type | Description |
<variable> | STRING | Variable to store the count of the elements for the specified locator. |
<locator> | STRING | Address to locate the element for which the count has to be fetched.
Note: The value to this parameter can either be supplied with recorded locators stored as elements or hard coded with the necessary locators in the format "<locator>". Learn more. |
noofproducts | The variable that stores the count of how many products are visible on the website. |
".theme-prod-box" | The inspected locator for the products listed on the website. |
"There is a mismatch in the product count" | The message that has to be displayed, if there is a product count mismatch with the expected count. |
Parameter | Data Type | Description |
<variable> | STRING | Variable to store the value of width of the element. |
<locator> | STRING | Address to locate the element for which the width has to be fetched.
Note: The value to this parameter can either be supplied with recorded locators stored as elements or hard coded with the necessary locators in the format "<locator>". Learn more. |
productWidthCheck | Variable to store the width of the product's image. |
"//img[@class='zpimage zpimage-style-none zpimage-space-none ']" | The inspected locator of the product image. |
"Width of the product image is incorrect" | The message that has to be displayed, if the width of the product image is incorrect. |
Parameter | Data Type | Description |
<variable> | STRING | Variable to store the value of height of the element. |
<locator> | STRING | Address to locate the element for which the height has to be fetched.
Note: The value to this parameter can either be supplied with recorded locators stored as elements or hard coded with the necessary locators in the format "<locator>". Learn more. |
productHeightCheck | Variable to store the height of the product's image. |
"//img[@class='zpimage zpimage-style-none zpimage-space-none ']" | The inspected locator of the product image. |
"Height of the product image is incorrect" | The message that has to be displayed, if the height of the product image is incorrect. |
The task is a debugging statement which when executed displays the value of an appended expression.
info(<message>);
Parameter | Data Type | Description |
<message> | OBJECT | The value to be displayed.
You can directly specify a value, or you can also specify an expression, i.e. constants, <variables>, <operators>, <calls to functions> and so on, which evaluates to a value. |
"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. |
currencyType | The variable that stores the currency type chosen by the user. The user can choose between "INR" and "USD". |
"li[data-theme-base-currency]" | The inspected locator of the dropdown that contains the currency type on the website. |
handleAlert(<decision>,<message>);
Parameter | Data Type | Description |
<decision> | BOOLEAN | It takes a boolean logic value, either "TRUE" or "FALSE", which determines how the task should interact with the alert.
|
<message> | STRING | Message displayed in the alert, which has to be verified. |
handleAlert(<decision>);
| Parameter | Data Type | Description |
<decision> | BOOLEAN | It takes a boolean logic value, either "TRUE" or "FALSE", which determines how the task should interact with the alert.
|
"#zs-make-payment-button" | The inspected locator for the "Make Payment" button. |
5 | Specifying the time in seconds, for the payment to be done. |
True | The decision to accept or confirm the alert box. |
"Order #12345 has been shipped." | The order confirmation message displayed in the alert box. |
"#zs-clear-cart-button" | The inspected locator for the "Clear Cart" button. |
True | The decision to accept or confirm the alert box. |