Certification: AI-driven Test Automation
Certification: AI-driven Test Automation
Entering Data
You need to specify the string which you want to enter into the field as well as exactly where to enter it
enter "olive oil" into "search"
Don’t forget to use relative locations if needed!
enter "olive oil" into "search" to the left of "Accounts and lists"
Alternatively, you can use type command if the previous step has already put the cursor onto the text field:
click on "search"
type "olive oil"
What happens when you need to simulate clicking the “Enter” button?
enter enter into "Notes"
For multi-line text inputs, all you need to do is specify lines, as well as the end of the text:
enter text starting from next line and ending with [END]
line1 "Hello Max,"
line2 "Let's discuss the opportunity" [END] into "Notes"
Checking checkboxes
There will typically be multiple checkboxes on the page. In this case, you need to provide additional context – so that testRigor knows which checkbox you want to use. You can use the browser’s inspect feature to locate the label of the element, or its id, or use a relative location. Indexes work too.
click on checkbox to the left of "Add to cart"
click on 2nd checkbox "id"
Use “enter” command if you need to fill in the checkbox with a number:
enter "1" into "checkbox_3"
enter "1 into checkbox to the left of "Add to cart"
Q: Write two ways you can enter number 5 in a checkbox with the label “my_checkbox”
Dealing with dropdowns
Use the “select” command to select a value from a dropdown. Specify the value, as well as the name of the dropdown:
select "Books" from "All"
Native browser vs. custom dropdowns
There are a lot of different types of dropdowns. testRigor can identify most of them, but some might not be identifiable as a dropdown. But worry not, there’s always a solution. In this case, you have two options:
-
Use developer tools to identify dropdown’s class or id. In case of using the class, add relative location for extra reliability
enter "Books" into "class_name or id" to the left of "Amazon"
-
Click on the dropdown to expand it, and then click on the value
click "All" in the context of "search" click "Books"
testRigor has 3 options to identify dropdowns, this setting can be changed under Settings > Advanced > Dropdown detection strategy. Typically you might want to change it only if detecting dropdowns takes too long, and you want the test to run faster.
- Use Machine Learning to detect dropdowns – Default option
- Optimistic, attend to guess dropdowns – The least accurate
- Pessimistic, only rely on known dropdowns – The most accurate and also fastest, but will identify fewer dropdowns than Machine Learning
Dealing with tables
You can refer to elements of the table by specifying row and column. And to specify a row there is a powerful SQL-like language available. For example, you can say things like:
click "Delete" inside of table at row containing "my unique id" and column "Actions"
Here we didn’t specify the column where the “my unique id” should reside, but rather indicated that it could be in any column at that row.
You can also construct SQL-like expressions containing one or multiple columns with different validations. For example:
check that table with "Country" equal to "United States" and "City" equal to "Saint Petersburg" and "State" equal to "Florida" at column "Status" contains "Flourishing"
Here we used 3 different conditions to identify the row connected with the boolean operator AND. The following boolean operators are supported:
- AND
- OR
- NOT
- Brackets ()
and you can also use brackets. The condition calculation will follow the standard boolean logic. The condition above could also be expressed like so:
check that table with not("Country" not equal to "United States" or "City" not equal to "Saint Petersburg" or "State" not equal to "Florida") at column "Status" contains "Flourishing"
You can learn more about how boolean operators work here.