Co.meta offers versatile and easy to use steps like "Goto URL {URL}" or "Move mouse to {selector} and click". Below is a list of grouped actions by topic.
- Browser actions
- API actions
- AI - actions
- Conditional - actions
- Validation - actions
- CSS selectors actions
- Feature actions
- Mouse actions
- Keyboard actions
- IBM actions
- IBM Cognos QueryStudio actions
- Editing Excel Files
- Uploading and Downloading files
- Other actions
- Action Examples
- Support
Actions or steps are the build blocks from where your tell Co.meta what you want to automate. You have actions for clicking, browsing, screen sizing, downloading, can send keys and so on and so on.
We have grouped the different actions and the first one is "Browser actions".
The first steps in your testplan will probably be Goto "{URL}" - make sure to leave the quotes and replace anything else. Do not worry about escaping your quotes. Co.meta does that for you.
A very versatile step is Run Javascript function "{function}" - function can be anything you can execute as Javscript inside a browser. It can be just one command or a complete snippet. This brings you low-code.
If you have suggestions or needs for a step / actions that you would rather implement in python, then please download the Co.meta repo and have a look actions.py for the code of any step that was implemented here.
Action | Description | Example |
---|---|---|
StartBrowser and call URL "{url}" | Browse to an URL | |
Goto URL "{url}" | Browse to an URL | |
Maximize the browser | Maximizes the browser window | |
I resize the browser to "{x}" x "{y}" | Resizes the browser window to X and Y, useful for virtual mobile testing | |
I can resize the browser to "{x}" x "{y}" | Checks if it can resize the browser window to X and Y, useful for virtual mobile testing | |
I can close the window | Closes the current window | |
Close the browser | Closes the browser and reverts to latest opened tab/window if available | |
I can close the window | Closes the current window | |
I can switch to new Window | Switches to another existing (or just created) Window/Tab (e.g. popup window) | |
I can switch to main Window | Switches to the main Window/Tab | |
I switch to default content | Changes the testing context to the main document in the current Tab/Window, similar to using window.top I can switch back to default content, e.g. if I switched to iFrame before |
|
BrowserTitle is "{browserTitle}" | Checks if the current Tab Title is/contains some sentence | |
Reload page | Reloads the current page Useful to reset to default settings (e.g. if elements are marked in a different color) |
|
Fetch Console.log from Browser and attach it to the feature result. | Fetches browser console logs and attaches them to the feature results. (Note : This step does not work with the Firefox browser. If used, it will result in an error.) |
You can use this JSON as an example to understand API actions. Please delete or disable the first step shown as an example and import this JSON to understand how to use API actions.
[{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Make an API call with \"GET\" to \"https://petstore.swagger.io/v2/pet/59462342\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Make an API call with \"GET\" to \"https://petstore.swagger.io/v2/pet/59462342\" with \"params:param1=value1;param2=value2\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Assert last API Call property \".request.path\" to \"match\" \"\"/v2/pet/59462342?param1=value1¶m2=value2\"\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Make an API call with \"GET\" to \"https://petstore.swagger.io/v2/pet/59462342\" with \"params:param1=value1;param2=value2\" and \"headers:header1=value1;header2=value2\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Assert last API Call property \".response.content.tags[0].name == \"string\"\" to \"contain\" \"false\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Assert last API Call property \".response.content.category.id == 0\" to \"match\" \"true\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Assert last API Call property \".response.content.photoUrls | length > 0\" to \"match\" \"true\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Save last API Call property \".response.content.name\" to \"petName\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Assert \"$petName\" to be same as \"\"doggie\"\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Assert last API Call property \".response.status_code\" to \"match\" \"200\"","step_type":"normal","continue_on_failure":false,"timeout":60}]
Action | Description | Example |
---|---|---|
Make an API call with "{method}" to "{endpoint}" with "params:{parameters}" and "headers:{headers}" | Create API step using this action where, the method is HTTP method (GET, POST, PUT or DELETE , etc), the endpoint is your API to be called (i.e.https://petstore.swagger.io/v2/pet/59462342 )
Optionally you can set query parameters and headers using the format Key=Value , with semicolons ; used to separate key-value pairs (e.g., Key1=value1;Key2=value2 )
The Request and Response data from the last API call will be stored in memory, which can be accessed using the steps below |
Example 1 Make an API call with "GET" to "https://petstore.swagger.io/v2/pet/59462342"
Example 2 Make an API call with "GET" to "https://petstore.swagger.io/v2/pet/59462342" with "params:param1=value1;param2=value2"
Example 3 Make an API call with "GET" to "https://petstore.swagger.io/v2/pet/59462342" with "params:param1=value1;param2=value2" and "headers:header1=value1;header2=value2"
|
Assert last API Call property "{jq_pattern}" to "{condition}" "{value}" |
Assert api request and response data using JQ patterns. Please refer [JQ Documentation](https://jqlang.github.io/jq/manual/)
jq_pattern is a JSON path that can also be combined with conditions to perform assertions, as shown in the given examples The condition parameter can take either match or contain as a value to assert the JSON
value is the content with which we want to match
Note: While comparing string remember to wrap string with "" |
Example 1 Validate request data
Assert last API Call property ".request.path" to "match" ""/v2/pet/59462342?param1=value1¶m2=value2""
Example 2 Validate response data Assert last API Call property ".response.content.tags[0].name" to "match" ""string""
Example 3 Validate response data with JQ patterns Assert last API Call property ".response.content.tags[0].name == "string"" to "match" "true"
Example 4 Validate response data with JQ patterns Assert last API Call property ".response.content.category.id == 0" to "contain" "true"
Example 5 Validate response data with JQ patterns Assert last API Call property ".response.content.photoUrls | length > 0" to "match" "true"
Example 6 Validate response status code Assert last API Call property ".response.status_code" to "match" "200"
|
Save last API Call property "{jq_pattern}" to "{environment_variable}" | The last API request and response data can be saved into an environment variable using this action, which can then be used as a value for other steps or for performing assertions when required |
Example 1
Save last API Call property ".response.content.name" to "petName"
Then, use the saved data in other steps. Assert "$petName" to be same as ""doggie""
|
Action | Description | Example |
---|---|---|
Validate current screen to contain "{object_name}" with "{options}" | Validates whether the current screen contains a specified object. Additional options can be provided to refine the validation. |
Example 1:Validate current screen to contain "Car" Example 2 (refine validation): Validate current screen to contain "Car" with "color:red"
|
Get list of visible objects in the current screen and store in "{variable}" with "{options}" | Retrieves the list of visible objects on the current screen and stores it in a specified variable. Additional options can refine the list. |
Example 1:Get list of visible objects in the current screen and store in "myObjects" Example 2 (refine validation): Get list of visible objects in the current screen and store in "myObjects" with "visible_only"
|
Get information based on "{user_message_to_ai}" and store in "{variable}" with "{options}" | This step allows you to send a specific request or instruction to the AI, along with images or other data for analysis. The AI's response will be stored in a specified variable. Optionally, you can modify how the result is processed by using the "Output JSON" option. |
Example 1:Get information based on "[{\"content\": \"Get the visible car color\", \"images\": [\"screenshot1\"]}]" and store in "chart_analysis" with "Output JSON" Example 2: Get information based on "[{'content': 'Identify all buttons on the screen', 'images': ['ui_screenshot']}}]" and store in "button_list" with "Output JSON"
|
Get screenshot and store in the variable "{variable_name}" | This step captures a screenshot of the current screen and stores it in the specified variable. |
Example 1:Get screenshot and store in the variable "current_screen"
|
Show me variable "{variable_name}" value for "{seconds}" seconds | Displays the value of a specified variable for a certain number of seconds. |
Example 1:Show me variable "myVariable" value for "5" seconds
|
Assert variable "{variable_name}" using jq_pattern "{jq_pattern}" to "{condition}" "{value}" | This step asserts that a value within a stored variable matches or contains a specified value using a JQ pattern. It is useful for validating JSON-like data structures stored in variables. |
Example 1:Assert variable "api_response" using jq_pattern ".status" to "match" "success" Example 2: Assert variable "api_response" using jq_pattern ".message" to "contain" "completed successfully"
|
Assert variable "{variable_name}" to "{condition}" "{value}" | Asserts the value of a variable directly using a condition (match or contain). |
Example 1:Assert variable "status_code" to "match" "200" Example 2: Assert variable "response_message" to "contain" "Operation completed"
|
Action | Description | Example |
---|---|---|
If "{value1}" "{condition}" "{value2}" | Checks if `value1` is exactly equal to `value2`. |
Example 1:If "$is_visible" "equals" "True"
|
Checks if "value1" is not equal to "value2". |
Example 1:If "$variable_1" "not equals" "$variable_2" Example 2: If "$variable_1" "not equals" "Pink"
|
|
Checks if "value1" contains the substring "value2". |
Example 1:If "$message" "contains" "success"
|
|
Checks if "value1" does not contain the substring "value2". |
Example 1:If "$message" "not contains" "error"
|
|
Checks if "value1" is greater than or equal to "value2" (numeric comparison). |
Example 1:If "$response_time" ">=" "200"
|
|
Checks if "value1" is less than or equal to "value2" (numeric comparison). |
Example 1:If "$response_time" "<=" "500"
|
|
Checks if "value1" is equal to "value2" (numeric comparison). |
Example 1:If "$score" "=="` "100"
|
|
Checks if "value1" is not equal to "value2" (numeric comparison). |
Example 1:If "$score" "!=" "50" |
|
Else | Specifies the alternative case when `$is_visible` is not `True`. | Else. |
End If | Closes the conditional block started by `If`. | End If. |
Action | Description | Example |
---|---|---|
Validate if "{selector}" present in the browser in "{time}" seconds and save result in "{variable}" | Checks if the specified selector is present in the browser within the given time and saves the result to a variable. |
Example 1:Validate if "//h1[contains(text(),'Explore projects')]" present in the browser in "15" seconds and save result in "is_visible"
|
Validate if "{selector}" appeared in the browser in "{time}" seconds and save result in "{variable}" | Checks if the specified selector is visible in the browser within the given time and saves the result to a variable. |
Example 1:Validate if "//h1[contains(text(),'Explore projects')]" appeared in the browser in "15" seconds and save result in "is_visible"
|
Action | Description | Example | |
---|---|---|---|
I move mouse to "{css_selector}" and click | Moves the mouse to the css selector and click | when I Move mouse to "[id="ibis-contract-search:ibis-contractstates"]" and click | |
I move mouse over "{css_selector}" | Moves the mouse to the center of css selector | when I move mouse over "[id="ibis-fvn:ibis-contractcontext-selected"]" | |
Focus on element with "{css_selector}" | Focus on element using a CSS selector | when I Focus on element with "[id="ibis-fvn:ibis-contractsearch"]" | |
I can click on element with css selector "{css_selector}" | Checks if it can click on an element using a CSS Selector | then I can click on element with css selector "[id="ibis-fvn:ibis-searchcontract"]" | |
I can see element with css selector "{css_selector}" | Checks if it can see an element using a CSS Selector | then I can see element with css selector "[id="ibis-fvn:ibis-searchcontract"]" | |
Check if "{css_selector}" contains "{value}" in "{css_property}" | Checks if an element contains a given text inside a css-property like background-image, fontSize, etc. | Check if "[id="navbar"]" contains "#f00" in "background-color" | |
Check if "{css_selector}" contains "{value}" in JS property "{js_property}" | Checks if an element contains a given text inside a js-property like innerText. Use "caseInsensitive:" to ignore the spelling of the value. |
Check if "[id="ibis-welcometext"]" contains "$SAW_User" in JS property "innerText" Check if "td.pf > table.tb > tbody > tr > td:nth-child(1) > span:nth-child(1)" contains "caseInsensitive:$SAW_username" in JS property "innerText" |
|
Scroll to element with css selector "{selector}" | Scroll to an element using a CSS Selector | ||
There is no coincidence with css selector "{selector}" | Checks if an element doesn't exist using a CSS Selector | ||
Save "{value}" to environment variable "{variable_name}" | save string value to environment variable, environment variable value has a maximum value of 255 characters |
This step has multiple use cases, like setting static value or save parsed data from other steps like Javascript function. Examples:
|
|
Save selector "{css_selector}" value to environment variable "{variable_name}" | save css-selector's property value if available else gets selector's innerText and saves it as an environment variable, environment variable value has a maximum value of 255 characters | Save selector "#ibis-fhn:ibis-center-id_label" value to environment variable "center" | |
Save list values in selector "{css_selector}" and save them to variable "{variable_name}" | Same as above but for several values which are saved as a list separated by semicolon. Use "unique:" to remove duplicates from the saved list. Note: Cannot save content like < span >< /span >(empty) |
Save list values in selector "[id*=ibis-center-id_items] li" and save them to variable "IBIS_CenterList" Save list values in selector " id="ibis-system-jobs\:ibistab-panel\:table-container\:ibis-system-mec-jobstable_data"] tr:nth-child(n) td:nth-child(2)" and save them to variable "unique:IBIS_MEC" |
|
Set value "{text}" on "{selector}" | Set a value on an element, normally used for inputs | ||
Scroll to "{amount}"px on element "{selector}" | Scrolls to a given amount of pixels in the Y axis inside a specific element using a CSS selector | ||
I use selector "{number}" and select option "{index}" for Cognos prompt page | Selects an option defined with index from selector index defined with number. Index and number start from 0 for first element. |
||
I can select option "{option_value}" for "{css_selector}" | Selects an option value in a select input using a CSS Selector | I can select option "$centerID" for "[name="p_pt_Center"]" (feature #336) | |
I use selector "{css_selector}" and select option "{value}" | Selects an option value or index for a given select element using a CSS Selector or an index. {css_selector} variable allows for the following prefixes: index:|value: {value} variable allows for the following prefixes: index:|value:|contains: Example: I use selector "index:2" and select option "contains:Financial" Index starts from 1 for first element. |
I use selector "[name="p_pt_Center"]" ... I use selector "index:2" and ... I use selector "[name="p_pt_Center"]" and select option "$centerID" I use selector "[name="p_pt_Center"]" and select option "index:3" I use selector "[name="p_pt_Center"]" and select option "contains:Financial" |
|
Test list of "{css_selector}" elements to contain all or partial values from list variable "{variable_name}" use prefix "{prefix}" and suffix "{suffix}" | Compares any content of a css selector (e.g. table, dropdown options) to a list saved in variable. Several variable lists can be combined, separated by "|" (pipe). Note: Cannot test content like < span >< /span > (empty). Or list like " ;a;b;c; ;e;f" |
1 list: Test list of "{css selector}" elements to contain all or partial values from list variable "IBIS_MEC" use prefix " " and suffix " " 2 lists: Test list of "table[class="ls"]>tbody>tr:nth-child(n+3)>td [cid="11"]>span" elements to contain all or partial values from list variable "ENL_VINs|RIT_VINs" use prefix " " and suffix " " |
|
Loop "{x}" times starting at "{index}" and do / End loop | Starts a loop cycle, repeating inside defined actions as many times as indicated in "x" starting from as indicated in "index" |
Step 1: StartBrowser and call URL "https://datatables.net/" Step 2: Loop "5" times starting at "1" and do Step 3: click on element with xpath "//tr[contains(@class, "even") or contains(@class, "odd")][%index]/td[1]" Step 4: I sleep "1" seconds Step 5: End Loop Will loop over first 5 tr elements with class "even" or "odd" and click first occurrence of td for each of them _________________________________________________________ Step 1: StartBrowser and call URL "https://google.com/" Step 2: I move mouse to "//div/button[2]" and click Step 3: I move mouse to "//input" and click Step 4: Loop "5" times starting at "1" and do Step 5: Send keys " : Index %index : " Step 6: End Loop Will open google and introduce in search input : index 1 : : index 2 : : index 3 : : index 4 : : index 5 : _________________________________________________________ |
Action | Description | Example |
---|---|---|
Schedule Job "{feature_name}" using parameters "{parameters}" and crontab pattern "{schedule}" | Schedule a job that runs a feature with specific key:value parameters separated by semi-colon (;) and crontab patterned schedules like "* * * * *" schedule can use < today > and < tomorrow > which are replaced dynamically | |
Delete schedule that executed this feature | Removes the schedule that executed this feature y executed manually the step is ignored | |
Run feature with id "{feature_id}" before continuing | Runs another feature using it's ID in the same context, useful to import common steps in multiple features | |
Run feature with name "{feature_name}" before continuing | Runs another feature using it's name in the same context, useful to import common steps in multiple features |
Action | Description | Example |
---|---|---|
Scroll to "{amount}"px | Scrolls the page to a given amount of pixels in the Y axis | |
I can click on button "{button_name}" | Checks if can click in a button with the specified name attribute text | |
I can click on button with title "{button_title}" | Checks if can click in a button with the specified title attribute text | |
I select option "{option_value}" | Selects an option value in a select input | |
I click on element with classname "{classname}" | Tries to click on an element with the specified class | |
Scroll the opened folder to the bottom | Scroll the opened folder to the bottom | |
click on element with xpath "{xpath}" | Click on element using an XPath Selector | |
I can Control Click at "{element}" | Do a Ctrl + Click using a CSS Selector | |
Download a file by clicking on "{linktext}" | Downloads a file, the downloaded file is assigned to feature_result and step_result (linktext can be a text, css_selector or xpath). The downloaded file is saved in the file systems at behave/Downloads/{feature-run-id}/remove-filename.suffix. To be able to test on generic filenames, that get random generated Id's, Cometa saves a copy of the file to last_downloaded_file.suffix maintaining the suffix of the original filename. | |
Drag "{element_selector}" and drop it in "{destination_selector}" | Drag an element and drop it to the destination element | |
Scroll to the last position of the desired element identified by "{xpath}" with maximum number of scrolls "{MaxScrolls}" and maximum time of "{MaxTimeOfLife}" | Scroll to element with "{xpath}" repeatedly until it finds last position. This feature is useful when searching for an element that is not initially loaded and requires multiple dynamic loads. |
Scroll to the last position of the desired element identified by "//ol/li[last()]" with maximum number of scrolls "50" and maximum time of "120" |
Scroll to element with "{selector}" in lazy loaded table "{scrollable_element_selector}" | This step scrolls to a selector contained in a lazy loaded table which only shows up to few elements and the rest of them are dynamically loaded. For example AG-Grid tables. |
Action | Description | Example | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Send keys "{keys}" | Send any keys, this simulates the keys pressed by the keyboard | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Press Enter | Press the Enter key | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I can do a basic auth with username "{username}" and "{password}" | Do a login using Basic Auth credentials, please use variables to mask sensitive values like passwords | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Press the following set of keys "{keySet}" | Presses a set of key sent by the user as a parameter. If the keys are separated by '+', press them simultaneously. If they are separated by ';', start pressing the keys once the previous set is released. The key combination won't work if the browser state is modified (create new tab, close browser...).
Here is the complete list of Special Keys that can be used in Cometa via Selenium Webdriver:
|
Press the following set of keys "shift+alt+f;shift+alt+a" |
Action | Description | Example |
---|---|---|
Test IBM Cognos Cube Dimension to contain all values from list variable "{variable_name}" use prefix "{prefix}" and suffix "{suffix}" | Compares a Report Cube's content to a list saved in variable. Works for dimension with > 50 members (members can be searched) |
Test IBM Cognos Cube Dimension to contain all values from list variable "IBIS_CenterList" use prefix "IBIS-" and suffix " " |
I can test current IBM Cognos folder | Tests the folder the user is currently in | Runs a test on anything in the current folder. |
I can go to IBM Cognos folder "{folder_name}" | Navigates to the selected folder. If folders are nested use ";" to separate items. | I can go to IBM Cognos folder "Enterprise Basic; Business Reports;02 Monthly Reports" |
I can test current IBM Cognos folder using parameters "{parameters}" | Tests the folder the user is currently in with the inputted parameters. Parameters is a pair of "key1|key2|key3:values;", where each key is the name a prompt parameters and the corresponding value. Multiple keys can be tied to one value like this: p_PERIOD|p_REPORTINGPERIOD|p_PER:2025-01 |
Action | Description | Example |
---|---|---|
I can sort QueryStudio table column with "{column_name}" | Sort a QueryStudio table by a given column name | |
I can add an column with "{column_name}" to QueryStudio table | Add a column name in a QueryStudio table | |
I can add an filter with "{filter_name}" to QueryStudio table | Add a filter name to a QueryStudio table | |
I can add an filter to column "{column_name}" with "{filter_value}" to QueryStudio table | Add a filter name with a value to a QueryStudio table | |
I can set not to the filter "{filter_text}" | Negate a filter name | |
I can remove the filter "{filter_text}" | Remove a filter name from a QueryStudio table | |
I can delete QueryStudio table column with "{column_name}" | Remove a column name from a QueryStudio table | |
I can cut QueryStudio table column with "{column_name}" and paste it before column with "{column_name_2}" | Moves a column name before another column name |
Cometa uses openpyXL library for working with Excel files. This library is powerful, when it comes to handling with Excel, it can transform Excel lists in Crosstabs, set formatting and many more. Cometa only uses Edit and Assert value for now. Feel free add functionality you need.
Action | Description | Example |
---|---|---|
Edit "{excelfile}" and set "{value}" to "{cell}" | Opens the excel file and sets a value to a cell. | Example: Edit "Downloads/myexcel.xlsx" and set "Cometa was here" to "C3" |
Open "{excelfile}" and assert "{value}" is in cell "{cell}" | Opens the excel file and asserts that value is found in cell. | Example: Open "Downloads/file_example_XLSX_1000.xlsx" and assert "COMETA" is in cell "A2" |
Open "{excelfile}" and set environment variable "{variable_name}" with value from cell "{cell}" | Opens the excel file reads value found in cell and saves that value to a Cometa environment variable. | Example: Open "Downloads/file_example_XLSX_1000.xlsx" and set environment variable "EXCEL" with value from cell "E2" . This will result in the environment variable EXCEL to contain the value "United States". |
Open Excel from "{file}" and test that cells "{excel_range}" contain "{values}" options "{match_type}" |
Opens Excel or CSV file and asserts the values in the cell range specified.
Cell range can be any number of range as long as it cell length is not grater than the values length. If we don't know how many items there are in the values we can use a range like A12:A this will take A12 as a starting cell and calculate the rows based on the items in values. This only works vertically (rows) so range like A12:C won't work. Other possible ranges can be: A12:500 or even A12:C13 , this last one will assert the value in the following order: A12 => B12 => C12 => A13 => B13 => C13 .
Values are content that will be asserted and should be separated by semicolons (;). Match type can be one of the followings: match exact : Will fail the step if any of the assertions are failed. For e.g.: A12 should contain "Hi!" but contains "Hello!".match partial : Will pass the step if any of the assertions are passed. For e.g.: A12 should contain "Hi!", contains "Hello!" but A13 should contain "Bye" and matches to cell value "Bye". Overall step passes.match any : WIPmatch x number of times : WIPGenerates an CSV file containing all the details about the assertions and why if might have failed. |
Examples:
Open Excel from "Downloads/last_downloaded_file.xlsx" and test that cells "A1:A" contain "Arslan;Ralf;Tornike" options "match exact"
Open Excel from "Downloads/last_downloaded_file.csv" and test that cells "A20" contain "500" options "match exact"
Open Excel from "Downloads/last_downloaded_file.csv" and test that cells "A20:C20" contain "2019;2020;2021" options "match partial"
|
Here is a test example for further demonstration:
[{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"# download an excel file","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"StartBrowser and call URL \"https://file-examples.com/index.php/sample-documents-download/sample-xls-download/\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"################ download file from given link in HTML ################","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Download a file by clicking on \"(//a[contains(@href,'_1000.xls')])[2]\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":false,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Run feature with name \"WAIT-LOOP\" before continuing","step_type":"subfeature","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"# open that excel file","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Goto URL \"https://products.aspose.app/cells/es/viewer\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Upload a file by clicking on \".uploadFileInput\" using file \"Downloads/file_example_XLSX_1000.xlsx\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"I sleep \"10\" seconds","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"# edit the excel file","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":false,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Run feature with name \"WAIT-LOOP\" before continuing","step_type":"subfeature","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Edit \"Downloads/file_example_XLSX_1000.xlsx\" and set \"COMETA\" to \"A2\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Edit \"Downloads/file_example_XLSX_1000.xlsx\" and set \"was\" to \"B2\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Edit \"Downloads/file_example_XLSX_1000.xlsx\" and set \"here\" to \"C2\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"# Reopen the excel file to see the changes","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Goto URL \"https://products.aspose.app/cells/es/viewer\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Upload a file by clicking on \".uploadFileInput\" using file \"uploads/file_example_XLSX_1000.xlsx\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"I sleep \"10\" seconds","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"# Assert that a certain cell has a certain value","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Open \"Downloads/file_example_XLSX_1000.xlsx\" and assert \"COMETA\" is in cell \"A2\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":false,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"I sleep \"10\" seconds","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Open \"Downloads/file_example_XLSX_1000.xlsx\" and set environment variable \"EXCEL\" with value from cell \"E2\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"I sleep \"10\" seconds","step_type":"normal","continue_on_failure":false,"timeout":60}]
Action | Description | Example |
---|---|---|
Upload a file by clicking on "{selector}" using file "{filename}" | Uploads a file to an input selector | Upload a file by clicking on "//input[@id="upload-button"]" using file "uploads/dummy.png;uploads/dummy.mp4" ... you can upload multiple file by separating them by a semicolon. The semicolon is being replaced by a carriage return in Cometa. |
Download a file by clicking on "{linktext}" | This will download the file in the linktext to the Downloads folders of the headless browser. | If you are downloading a generic file, you can use `last_downloaded_file.{same suffix}` to access files that have ID's automatically generated. |
Attach the "{filename}" from Downloads folder to the current execution results | This will attach the file found in Downloads-folder to the current execution. | This is useful, if you want to examine the file in your test execution instead of your application. The filename should just be the filename. Cometa will automatically at the correct folder to the file to be downloaded from your feature results, as this is depending on the result execution number, which also goes directly into the download link. |
Action | Description | Example |
---|---|---|
A set of environments | Sets a comma separated list of environments | |
Environment "{env}" | Set Environment ID | |
I can test the folder "{foldername}" | Test if can access to a folder relative to the root directory of the URL specified | |
I can see "{something}" on page | Checks if the current source code contains something, is case sensitive! | |
I can see a link with "{linktext}" | Checks if the current source code contains a link with the desired text, is case sensitive! | |
I can switch to iFrame with id "{iframe_id}" | Switches to a iframe tag inside the document within the specified ID. It is also possible to switch to an iframe based on its index, e.g., 1 or 2 ... | |
I can switch to iFrame with name "{iframe_name}" | Switches to an iframe tag inside the document within the specified name | |
I can see a link with "{linktext}" in iframe | Check if the source code in the previously selected iframe contains a link with text something | |
I can see "{something}" | Checks if the source code contains some text (it is case sensitive!) | |
I sleep "{sleeptime}" seconds I can sleep "{sleeptime}" seconds |
Sleeps for X seconds Helps to take screenshots properly until next action is done |
|
Wait until I can see "{something}" on page | Wait until I can see something (text/content) on the page. Useful when sleep or loading times are unknown Timeout after 60s. |
then wait until I can see "< span id="ibisscreen-id" >cm002< /span >" on page |
Wait "{timeout}" seconds for "{selector}" to appear and disappear using option "{option}" | This step waits for the selector to appear within the given timeout (in seconds) and then wait the step timeout to disappear. The available options are 'do not fail if not visible' or 'fail if never visible'
If the selector does not appear within the specified timeout, and the selected option is: 1. "do not fail if not visible" then the step will not fail, and it will skip the wait for it to disappear2. "fail if never visible" then step will fail3. "reload page after appearing" then the page is reloaded 0.5 seconds after the selector appear4. "reload page while waiting to disappear" then the page is reloaded every minute while waiting to disappear.Useful when testing loading, notification pop-ups, selector that appears and disappears after reloading or selector that appear and disappears within specific time Note This step checks for the presence and visibility of the selector on the screen. If the selector is present in the DOM but hidden due to CSS properties, the step will fail if selected option is 'fail if never visible'
Try using this example |
Examples 1 The spinner appears within 1 second and disappears within 40 seconds. Create step with a timeout of 2 seconds and a step timeout of 60 seconds, using the option 'do not fail if not visible', the step will run for 41 seconds with success
Wait "2" seconds for ".remove-element .loader" to appear and disappear using option "do not fail if not visible"
Examples 2 The spinner appears within 1 second and disappears within 13 seconds. Create step with a timeout of 2 seconds and a step timeout of 60 seconds, using the option 'do not fail if not visible', the step will run for 14 seconds with success Wait "2" seconds for ".hide-element .loader" to appear and disappear using option "do not fail if not visible"
Examples 3 The spinner never appears and step timeout of 2 seconds and a step timeout of 60 seconds, using the option 'do not fail if not visible', the step will run for 2 seconds with success Wait "2" seconds for ".hide-element .loader" to appear and disappear using option "do not fail if not visible"
Examples 4 The spinner appears within 10 seconds and disappears within 15 seconds. Create step with a timeout of 2 seconds and a step timeout of 60 seconds, using the option 'do not fail if not visible', the step will run for 2 seconds with success Wait "2" seconds for ".hide-element .loader" to appear and disappear using option "do not fail if not visible"
Examples 5 The spinner appears within 10 seconds and disappears within 15 seconds. Create step with a timeout of 2 seconds and a step timeout of 60 seconds, using the option 'fail if never visible', the step will run for 2 seconds and fail Wait "2" seconds for ".hide-element .loader" to appear and disappear using option "fail if never visible"
Examples 6 The selector appears within 20 seconds and disappears after 10 minute and to check if disappeared page reloading is required, Create step with a timeout of 21 seconds and a step timeout of 605 seconds (10*60 + 5 sec extra), using options 'reload page while waiting to disappear;fail if never visible', the step will run for around 605 seconds and it will pass. Note : we have combined the two options reload page while waiting to disappear and fail if never visible , You can also combine it with do not fail if not visible .Wait "21" seconds for ".selector" to appear and disappear using option "reload page while waiting to disappear;fail if never visible"
Examples 7 The selector appears within 20 seconds and disappears when page reloaded, Create step with a timeout of 21 seconds and a step timeout of 25 seconds (20 + 5 sec extra), using options 'reload page after appearing;do not fail if not visible', the step will run for around 25 seconds and it will pass. Note : we have combined the two options reload page after appearing and do not fail if not visible , You can also combine it with fail if never visible Wait "21" seconds for ".selector" to appear and disappear using option "reload page after appearing;do not fail if not visible"
Examples 8 If #Load_in_15_Secs is a selector that appears within 15 seconds and disappears in the next 20 seconds. In this case, the step should be:
Wait "15" seconds for "#Load_in_15_Secs" to appear and disappear using option "do not fail if not visible"
And set a 35 second or more in step timeout because to complete the execution of this step will require 15 + 20 = 35 seconds.
Note: Even if the above step selector does not appear the step will not fail because the selected option is 'do not fail if not visible'
Examples 9 If #Load_in_20_Secs is a selector that appears within 20 seconds and disappears in the next 300 seconds, In this case, the step should be:
Wait "20" seconds for "#Load_in_20_Secs" to appear and disappear using option "fail if never visible"
And set a 320 second or more step timeout because to complete the execution of this step will require 20 + 300 = 320 seconds.
Note If the above step selector does not appear step will fail because selected option is 'fail if never visible'
Examples 2 Wait "22" seconds for "#Load_in_20_Secs" to appear and disappear using option "fail if never visible"
|
Wait until "{selector}" is loaded Useful as an alternative to the "wait until I can see something on page" step if you want to dynamically wait for an element to appear. |
then wait until "//div[@class='div_class_name']" is loaded | |
I can do a OIDC auth with username "{username}" and "{password}" | Do a login using OIDC Authentication, and please use variables to mask sensitive values like passwords. |
Example 1
Step 1: Select Action -> I can do a OIDC auth with username "{username}" and
"{password}"
Step 2: Enter -> "Test_User" Step 3: Enter -> "Test_Password" Example 2 Save password with encryption Step 1: Select Action -> I can do a OIDC auth with username "{username}" and "{password}"
Step 2: Enter -> "Test_User" Step 3: "Save your password in environment variables with encryption. Step 4: Enter "$myPasswordVariableName"
|
Run Javascript function "{function}" | Run a JavaScript function in the current browser context, if some value is returned from the function it will be saved as %js_return which can later be used in co.meta. |
Run Javascript function "return "$myCometaVariable".replace(/[^0-9]+/, "");"
|
Throw an error with "{message}" and leave | Throws an error with a custom message and stops feature execution | |
#{comment} | Insert custom comments in testplans | given #"here the comment starts" |
Edit "{excelfile}" and set "{value}" to "{cell}" | Updates excel file cell with new value. |
Step 1: StartBrowser and call URL "https://file-examples.com/index.php/sample-documents-download/sample-xls-download/" Step 2: Download a file by clicking on "(//td[text()="1000 rows"]/parent::tr//a)[2]" Step 3: Edit "Downloads/file_example_XLSX_1000.xlsx" and set "50" to "F2" Step 4: Goto URL "https://products.aspose.app/cells/es/viewer" Step 5: Upload a file by clicking on ".uploadFileInput" using file "uploads/file_example_XLSX_1000.xlsx" This will download an excel file with dummy data. Dummy file will be downloaded to Downloads/ , we will edit the file inside Downloads/ and update it's content. Once excel file is updated it will be save to uploads/ folder (for now, it might change in the future). Finally we view the edited file in an online excel viewer.
|
Create one-time password of "{x}" digits using pairing-key "{value}" and save it to encrypted variable "{variable_name}" |
It generates an OTP for Multi-Factor authentication and stores it in the provided variable_name
See detailed documentation on Automation of Multi Factor Authentication with Cometa |
Step 1: Select Action -> Create one-time password of "{x}" digits using pairing-key "{value}" and save it to encrypted variable "{variable_name}"
Step 2: Enter {x} -> "8" Length of OTP, | Default : 6, Options are [6, 7, 8] Step 3: Enter {value} -> "HVVH FUSO XXXX HLH7 FQKE JU2L ZZEU E2XV" Step 4: Enter {variable_name} -> "myOTPVariableName" |
You can import the below examples to create features and understand Cometa steps.
Example of Wait "{timeout}" seconds for "{selector}" to appear and disappear using option "{option}"
[{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"StartBrowser and call URL \"https://prod.cometa.rocks/loader_testing.html?appearTimeout=1&disappearTimeout=40&startWithLoader=false\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Wait \"2\" seconds for \".remove-element .loader\" to appear and disappear using option \"do not fail if not visible\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"StartBrowser and call URL \"https://prod.cometa.rocks/loader_testing.html?appearTimeout=1&disappearTimeout=13&startWithLoader=false\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Wait \"2\" seconds for \".hide-element .loader\" to appear and disappear using option \"do not fail if not visible\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"StartBrowser and call URL \"https://prod.cometa.rocks/loader_testing.html?appearTimeout=1000&disappearTimeout=13&startWithLoader=false\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Wait \"2\" seconds for \".hide-element .loader\" to appear and disappear using option \"do not fail if not visible\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"StartBrowser and call URL \"https://prod.cometa.rocks/loader_testing.html?appearTimeout=10&disappearTimeout=15&startWithLoader=false\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Wait \"2\" seconds for \".hide-element .loader\" to appear and disappear using option \"do not fail if not visible\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"StartBrowser and call URL \"https://prod.cometa.rocks/loader_testing.html?appearTimeout=10&disappearTimeout=15&startWithLoader=false\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Wait \"2\" seconds for \".hide-element .loader\" to appear and disappear using option \"fail if never visible\"","step_type":"normal","continue_on_failure":false,"timeout":60}]
For further questions or issues, please contact us at our email tec_dev@cometa.rocks or via Discord https://discord.gg/e3uBKHhKW5