Entering Data

Entering Data

You need to specify the string which you want to enter into the field as well as the field where it should be entered:
enter "olive oil" into "search"
You can use relative locations to help locate elements that are harder to pinpoint. However, this should be reserved for when there are several instances of the desired element.
enter "olive oil" into "search" to the left of "Accounts and lists"
If the previous step has already put the cursor onto the input field, you can use type command without specifying the input field name:
click "search"
type "olive oil"
Also use ‘type’/’enter’ to simulate pressing a key or a combination of keys on the keyboard.
type enter 
type ctrl a
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]
Hello Max,
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.
click checkbox to the left of "Add to cart"
We can also click by indexes, which means using the 1st, 2nd, 3rd, etc instance of an element on the page.
click 2nd checkbox "id"
Sometimes, developers use binary inputs as checkboxes. Clicking with JavaScript doesn’t always enable the checkbox in these instances, so we either click using the mouse or we use the “enter” command (0 = off, 1= on):
enter "1" into "checkbox_3"
enter "on" into checkbox to the left of "Add to cart"

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"
You can also select by the number the option appears in the dropdown:
select 1st option from "MySelect"
select second option from "MySelect"
select option 10 from "MySelect"
Read full documentation about entering data here.

Native browser dropdowns vs. Custom dropdowns

There are several types of dropdowns, but they are all placed in one of two categories: native browser dropdowns and custom dropdowns. The relevance of this is that native browser dropdowns  require direct interaction with the browser, and custom dropdowns require direct interaction with the UI.

Native browser dropdowns can be identified by their html tag <select>. For best results, we use the “select” command as specified above.

Custom dropdowns, however, are tagged as either <div> or <input>, thus allowing them to be interacted with more like a human would with clicks.

The following are the two most common types of custom dropdowns:

Standard dropdown:

The best way to interact with this type of custom dropdown by clicking on the dropdown to expand it, and then clicking on the value.
click "Select Year" on the right of "Model"
click "2017"

Auto-suggest dropdown: A users clicks a dropdown and types a partial or full term after which the dropdown displays options limited to those that match the string typed and the user clicks on the desired option.

There are two ways to interact with this type of custom dropdown:

  1. Enter and click (works better when the element is tagged as an <input>):
    enter "react" into "React Dropdown Select"
    click "ReactDropdownOption1"
  2. Click, type, and click (works better with <div> tags):
    click "React Dropdown Select"
    type "reactdrop"
    click "ReactDropdownOption1"

*Note that a partial string is preferred for the option typed into the field, and the full string is preferred for clicking. This is to avoid having two of the same exact strings on the page when the click command is used.

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, but it is also the slowest due to the fact that it uses machine learning
  • Optimistic, attempt to guess dropdowns – Turns off machine learning, but still uses other intelligence resources
  • Pessimistic, only rely on known dropdowns – Depends solely on the basic functionality, but it is the fastest. (<select> tags use the select "item" from "dropdownName" command; <div> and <input> tags are dealt with by clicking)

Test your knowledge

click checkbox “myCheckbox” 5 times
click 5th “myCheckbox”
type “5” for “myCheckbox”
select 5th checkbox “myCheckbox”
Use the “select” command
Use the “click, type, click” sequence
Use the “enter, click” sequence
Use the “enter, type, click” sequence