testRigor English-language support documentation

The goal of testRigor is to allow you to write your tests in your way of saying it in plain English.

Table of Basic Commands

We support a vast variety of commands. The list below contains many examples of how to express them.

Action Options Example
click double, right, middle, long, times, in a context of, using the mouse, using javascript, without scroll, using OCR, using OCR only
click "cart"
or:
click on the 3rd "hello" 5 times
or:
click "chrome" in the context of "Pixel 3 XL"
or:
click in the middle of the screen
or:
double click on the 3rd "hello"
or:
right click on the 3rd "hello"
or:
middle click on the 3rd "hello"
Note: You can use middle click to open links in a new tab
or:
long click on the 3rd "hello"
For web testing you can specify the way we click on an element as follows:
click using javascript on "hello"
or:
click on "hello" using the mouse
Note: In headless mode this option will be ignored as the only method available now is javascript
or:
click on "hello" without scroll
Note: You can use without scroll to prevent testRigor’s default behavior (scroll to the element before the click).
or:
click on image from stored value "Logo"
click on image from stored value "Logo" with less than "10" % discrepancy
click on the 6th element by image from stored value "logo" with less than "10" % discrepancy
Note: this sample uses an image stored with the name “Logo” in “Test Data”. The image is used to identify the location of the click. This type of click is useful when e.g. you need to click on an image map. Default discrepancy is 20 %
generate Simple Template, unique email, unique name,
RegEx, Google Code
Generate a unique email in testrigor-mail.com domain:
generate unique email, then enter into "Email" and save as "newEmail"
Generate a unique name:
generate unique name, then enter into "Name" and save as "generatedName"
Generate a unique phone number:
generate from template "###-###-####", then enter into "Phone" and save as "generatedPhone"
Generate a unique string of letters/numbers:
generate from template "%*********************************", then enter into "Description" and save as "generatedDescription"
Generate unique the date and time with unique parameters:
generate from template by string with escaped parameters "${nowDateTimeIso}-**********", then enter into "Data" and save as "generatedData"
Generate an email address in a custom domain:
generate from template "$******************************@testrigor-mail.com", then enter into "Email" and save as "newEmail"
Generate multi-line:
generate from regex text starting from next line and ending with [END]
[a-z0-9]{18}
line2[END], then enter into "JumboInput" and save as "JumboInput"
Generate and type:
generate from template "%$$$$$$$$$$", then enter and save as "generatedName"
Generate and save only:
generate from regex "[A-Z][a-z]{30}", and save as "generatedName"
Generate Google authenticator code for 2 steps validation login. It needs the user QRCode saved in a stored value to generate the code:
Generate google code from stored value "qr-code-image" and save it as "code"
enter enter, tab, escape, backspace, arrow right, arrow left, arrow up, arrow down, go, search, send, next, previous, done
enter stored value "actionNotes" into 3rd "Notes"
Note: enter supports selects/dropdowns/checkboxes/etc.
For checkboxes, you can do the following:
enter "1" into "my_checkbox"
For enter, tab, backspace, arrows or Android-specific go, search, send, next, previous, done:
enter enter into "Notes"
enter tab
enter arrow right
For multi-line inputs:
enter text starting from next line and ending with [END]
line1
line2[END] into "Notes"
For selects or dropdowns:
select "code or value" from "MySelect"
Also, it’s possible to select an option by position in selects or dropdowns:
select 1st option from "MySelect"
select second option from "MySelect"
select option 10 from "MySelect"
type
For typing free text into input fields
You may type text without referencing an input field if the previous step has already placed the cursor within the input field you wish to use:
click on "Notes"
type "This is a test."
For multi-line inputs:
click on "Notes"
type text starting from next line and ending with [END]
line1
line2
line3[END]
copy and paste text

Copy selected text (highlighted by either double clicking or dragging the mouse) to the clipboard:

copy selection to clipboard
copy to clipboard
copy selection
copy

Copy text from string (non-headless only):

copy to clipboard value "text_to_copy"
copy value "text_to_copy"

example
Copy text from saved value (non-headless only):

copy to clipboard from "variableName"
copy from "variableName"

example
In order to paste copied text click on the input field and use one of 2 commands:

paste from clipboard

or simply

paste
check page
Check page content by string:
check that page contains stored value from "actionNotes"
or
check that page contains "Hello"
Check page content (including the OCR recognized texts) by string:
check that page contains "Hello" using OCR
Check page content using OCR recognized texts only:
check that page contains "Hello" using OCR only
Check that page did not change after some action:
check that page didn't change compared to the previous step
check that page didn't change
Note: this action compares page images pixel to pixel
Check that page doesn’t have a fourth button:
check that page doesn't contain 4th button
check element
check that "element" contains stored value from "actionNotes"
and
check that "payout" contains "1000.00"
You can also validate whether an input/checkbox/button/etc. is disabled, clickable, or enabled
check that button "Add to Cart" is disabled
Check stored value itself:
check that stored value "createdName" itself contains "James"
Check that an element looks the same as during last successful run:
compare image of "my_div" to previous version with allowance of "5%"
Check that SMS is received:
check that sms to "+12345678902" matches regex "Code\:\d\d\d\d" and save it as "sms"
Check that file is downloaded and check its content:
check that file "instruction.pdf" was downloaded
check that downloaded file contains "app"
check that downloaded file "agreement.pdf" contains "agreement"
check that downloaded file "agreement.pdf" does not contain "liability"
check that file contains saved value "variableName"
Check that a container contains a nth element:
check that "container" contains 2nd "element"
Check that an element is changing. This is useful to check that some element that contains animation or video is updating:
check that "sparkles" is changing
check that video is playing
check that video "movie" is playing

You can also use a negative check:

check that "sparkles" is not changing
check that video is not playing
check that video "movie" is not playing
long press
long press on the 3rd "element"
hover
hover over 3rd "element"
open new tab
open new tab
switch tab
switch to tab "3"
or
switch to tab "popup"
Note: In order to easily keep track of tab numbers, testRigor’s default setting is to begin each test case in a new browser window. Therefore, tab “1” is always the tab the test case starts in, and tab “2”, “3” and so on are the new tabs in the order that they are opened throughout the test case run. For pop-ups, instead of a tab number, you will need to use the popup window name or title.
close tab
close tab
go back
go back
go forward
go forward
reload
reload
reset to home
reset to home
restart app
Restarts application without clearing data.
restart app
Note: This action is for mobile devices only.
drag element, file
drag "element1" to "element2"
Or file:
drag file "<URL>" onto "element"
drag file from saved value "File to upload" onto "element"
Or draw on a canvas:
drag "canvas1" with offset "0,0" to "canvas1" with offset "50,50"
If you need to drag a folder with files, you need to zip it and upload in Test Data section and use it like so:
drag folder from saved value "Zipped Folder" onto "element"
Note: This action does NOT work in headless mode. It also does NOT work with Internet Explorer
scroll down, up, left, right
scroll down
Or:
scroll down on "right_panel"
Partial scroll:
scroll down by 1/2 of the screen
You can also scroll directly to a specific part of the page:
scroll down until page contains "Submit"
Or:
scroll down until page contains link exactly "Contact Us"
swipe down, up, left, right
swipe right
wait time
wait 3 sec
Note: 2 min max
call api URL
call api "https://testrigor.ai/api" and save it as "result"
Or with more parameters:
call api post "http://dummy.restapiexample.com/api/v1/create" with headers "Content-Type:application/json" and "Accept:application/json" and body "{\"name\":\"James\",\"salary\":\"123\",\"age\":\"32\"}" and get "$.data.name" and save it as "createdName"
check that stored value "createdName" itself contains "James"
grab value Simple Template,
RegEx, element
grab value from "element" and save it as "variableName"
or, to grab a value from UserName:[email protected]
grab value of "(?<=UserName\:)[^ ]+" and save it as "generatedUsername"
or:
grab value of "(?<=UserName\:)[^ ]+" from "generated_section" and save it as "generatedUsername"
or, to grab a value using simple template:
grab value by template "(###) ###-####" and save it as "phoneNumber"
or:
grab value by template "(###) ###-####" from element below "Phone" and save it as "phoneNumber"
extract value by regex element
extract value by regex "regex" from saved value "variableNameFrom" and save it as "variableNameTo"
for example, to extract a value of username from variable var1 containing UserName:[email protected] you could use:
extract value by regex "(?<=UserName\:)[^ ]+" from "var1" and save it as "generatedUsername"
save value
save value "Peter" as "name"
store clipboard
Clipboard current value can be saved into a variable for later usage:
store clipboard value as "variable"
open url URL
open url "https://testrigor.ai?d=\"
Note: The domain must be whitelisted!
grab url
You can grab the browser’s current URL and save it into a variable:
grab url and save it as "variableName"
send email
Here is how to send a simple email:
send email to "[email protected]" with  subject "Test message" and  body "Hi, this is a test, this is just a test message."
To send an email with an attachment, you can upload the file into testrigor store in “Test Data” section, then use it by name as stored value. Alternatively you can use your own URL. If you choose to attach a file from your own URL, the link should be downloable.
send email from "[email protected]" to "[email protected]" with  subject "Test message", and  body "Hi, this is a test, this is just a test message.", and attachment from saved value "Sample File"
send email from "[email protected]" to "[email protected]" with  subject "Test message", and  body "Hi, this is a test, this is just a test message.", and attachment "http://online.com/file/name.pdf"
check email
check that email from "[email protected]" is delivered
Or
check that email to saved value "newEmail" was received
By default testRigor renders emails in a desktop browser. If you want to render it in the mobile device, you need to add the following suffix: and show in mobile E.g.:
check that email to "[email protected]" and "Confirm" in subject was received and show in mobile
You can use both – sender and recepient
check that email from "[email protected]" to saved value "newEmail" was received
By default we assume that the user expects one email message. Multiple emails will trigger an error message. It is possible to customise this behavior by specifying exactly how many emails are expected or just say “one or more”.
check that email to "[email protected]" and "Confirm" in subject was received
check that two emails to "[email protected]" and "Confirm" in subject were delivered
check that one or more emails to "[email protected]" and "Confirm" in subject were delivered
Also it is possible to filter messages by subject
check that email to "[email protected]" and "Confirm" in subject was received
Note: this command will render the email as if it is a web page. The to address here is not the same as “To” address in the email. check that email to will validate that email is delivered to one of the email recepients (To, Cc, Bcc). If there are more than one recepient, several commands may check for every recepient’s address.
reply to email
reply to email from "[email protected]" with "confirmed"
Or
reply to email to saved value "newEmail" with "confirmed"
reply to email to saved value "newEmail" from "[email protected]" and subject "Confirm" with "confirmed"
reply to email to saved value "newEmail" and subject "<regular expression>" with "confirmed"
Note: this command will render the received email (not the response) as if it is a web page
call phone number
call "+15344297154" and check it was picked up
Or, simply:
call "+15344297154"
sms phone number
sms to +15344297154 with body "hello"
Or
message +15344297154 with body "hi from testRigor" and verify it was delivered
set geo location (GPS Coordinates)
set geo location "40.7128,74.0060"
start browser / start device name
Starts a new browser with its own new session.
start browser "User 2"
Start and switch:
start browser "User 2" and switch
For device:
start device "User 2"
switch to browser / switch to device name
switch to browser "User 2"
For device:
switch to device "User 2"
Get back to the first browser:
switch to browser "default"
switch context to native / switch context to browser
Switch the context of the following actions to the entire mobile device (as for application testing) or start the mobile browser and use only its content (as for web testing).
compare type of element
Compares current elements on the current screen with the ones appearing the previous time the screen was shown.
compare inputs
compare texts
compare buttons
The following sentence compares element on the current test run screen with the one appearing on the reference screen or saved as a file pixelwise. If the element appears to be different, both baseline and current (failed) run element images will be saved in the artifacts for manual investigation.
compare image of "my_div" to previous version with allowance of "5%"
The sentence must contain an image definition, such as image of text "pressed", image of 3rd "peter", etc. Optionally it may contain an allowance value in percent. If missing, then it is assumed to be zero. If element size changed, centered intersection of the element is compared. Pixels are compared using mean squared error.
Silimarly you can make a screenshot of an image, save it, and then use as a reference like so:
compare image of "logo" to file "https://testrigor.com/assets/images/logo.png" with allowance of "5%"
compare image of "logo" to stored value "logoFile" with allowance of "5%"
login
login
Complex action. Identifies and performs the necessary steps to login.
crawl sitemap / go through sitemap
testRigor supports XML and Text sitemap formats.
crawl sitemap "https://app.testrigor.com/sitemap.xml"
crawl sitemap "http://online.com/sitemap.txt"
execute JavaScript in the browser
testRigor supports execution of vanilla Javascript in the browser.
execute JavaScript in the browser text starting from next line and ending with [END]
  document.querySelector("#input1").value = "John Doe";
[END]

Reusable Rules (Subroutines)

If you have a sequence that will be used often, you can save them as a Reusable Rule and refer to it with the name of your choosing.

Example: The first 6 steps of the example below will take you to your checkout page. If you frequently perform this process, create one rule to simulate all of those steps.
login
click "Men Clothing"
scroll down
click "Men's cargo shorts"
click "brown"
click "Size 34"
click "Add to cart"
check that page contains "Your order is nearly complete!"
Then, go to the Reusable Rules section in testRigor, assign the name “go to checkout page” to your rule, and add the first 6 steps above. From then on, you can simply use the syntax below to trigger all 6 steps:
go to checkout page
check page contains "Add to cart"

Referencing Locations and Elements

All references must be in double quotes, which can be escaped by backslash. There are several ways to refer to elements (for checks, clicks, entering data, etc.):
      1. References. check that "peter" color is "ffaabb" will search:
        1. Nested text – example
        2. Placeholder – example
        3. Value – example
        4. data-tid/data-testid/data-test-id/Id/resource-id/data-id – example
        5. Name – example
        6. aria-label – example
        7. CSS Class – example
        8. Label from ML classification – example
        9. Hint/Title/Tooltip – example
        10. Alt/Src – example
        11. For inputs/edits/dropdowns/selects/etc. will also search corresponding label – example
      2. Generic indexes. For example, check that second "peter" color is "ffaabb"

        example

      3. Types. For example, check that input "peter" color is "ffaabb" will fail id “peter” is not an input/edit. Supported types:
        1. text – example
        2. label – example
        3. button – example
        4. link – example
        5. input (or “edit” or “field”) – example
        6. dropdown (or “select”) – example
        7. checkbox (or “switch”) – example
        8. radiobutton – example
        9. file input (or “input file” or “edit file” or “input type file”): specifically an input of type file – example
      4. Typed indexes. For example, check that second input "peter" color is "ffaabb" will find the second input/edit related to “peter”.

        example

      5. Stored value for controls. For example, check that stored value "peter" color is "ffaabb" will resolve stored value “peter” and use that resolved value to find the control.

        example

      6. Multiple references. For example, check that "peter" or "john" color is "ffaabb" will find the first control related to either “peter” or “john”.

        example

      7. Image class. For example, click on "cart". testRigor classifies images on the screen and if there is a button which looks like a shopping cart it will click on it. Complete list of all button image categories is here.

        example

      8. Stored value for data. For example, check that "peter" contains stored value "actionNote" will find the second input/edit related to “peter”.

        example

All the ways to refer an element described above apply to all types of actions like check, enter, click, etc. The options above can be combined together.

Multiple references support.

In certain cases, certain elements might be expected to have different names but mean the same thing. For such cases, there is an “or” clause. For example,
click "checkout" or "submit"

example

And it can be combined with “if exists” to not to fail is the element doesn’t exist:
click "checkout" or "submit" if exists

example

Selecting elements in reference to other elements

You can select elements based on it’s position in relation to some other element. For example, you can refer to elements in certain sections like:
click on button "Delete" below "Actions"
Supported relative locations are:
    1. to the left ofexample
    2. to the right ofexample
    3. aboveexample
    4. belowexample
    5. on the right top ofexample
    6. on the left top ofexample
    7. on the right bottom ofexample
    8. on the left bottom ofexample
    9. nearexample
You can also refer to the elements by 2 references:
click on button "Delete" below "Section Name" to the right of "label"

example

In addition, you can specify how the relative position should be used:
  1. completely – default overlap with the target area is at least 30% – example
  2. with at least "10" percent overlap – similar to above but overlap can be specified – example
  3. roughly – element is anywhere below the cut line for “below”, to the right of for “to the right of” – example
For example,
enter "Peter" into roughly below "Section"
enter "Peter" into element with at least "1" percent overlap on the right of "Description"
Note, that the default behavior is “completely”. However, if there are 2 anchors specified, the first anchor defaults to “roughly” and the second one “completely”. I.e.
enter "Peter" into "Section" below and on the right of "Description"
is equivalent to:
enter "Peter" into "Section" roughly below and completely on the right of "Description"

Selecting elements in the context of other elements

You can select elements within the context of other elements. For example, you can pinpoint row at the table and ask to click a button in the context of that row:
click on "Delete" within the context of table "actions" at row containing "id1" and column "Actions"

example

You can use references to other elements (previous section) in the context itself
click on "Delete" within the context of "sectionTwo" below "Actions" and to the right of "rowName"

Selecting elements using reference to other elements and in the context of other elements

You can narrow where to look for an element using a combination of references to and in the context of other elements.
  1. Context is processed first, narrowing what to consider to what is inside that element
  2. References to other elements is processed next, only considering what was delimited by the context
click on "Button" below "Title" in the context of "sectionOne"

example

click on "Button" below "Title" and to the right of "leftHeader" in the context of "sectionTwo"

example

You can even specify up to 4 references to other elements using this combination
click on "Button" below "Subtitle" and to the right of "leftHeader" in the context of "sectionOne" below "Title" and above "Second Title"

example

Specifying the type of an element

You can force the system to only deal with a certain type of elements. The following command will not click on any text that is not a button or link:
click on strictly button "Delete"

example

Case sensitivity and exact matches

You can choose to deal with only “exactly” matches (i.e., case sensitive full strings match, or just say “case sensitive” to make matching case sensitive):
click on exactly "Delete"

example

It can be combined with the strict type selection like so:
click on strictly button exactly "Delete"

example

Fine-tuning access

In some cases, the target might be too wide, in this case you can force it to go deeper:
click deepest element "Delete"

example

It will issue click on the deepest element in the element tree that has the text.

Specifying position on screen

It is possible but highly discouraged (for stability reasons) to use offsets to click on specific part of an element:
click on "Delete" with offset "20,10"
offset is calculated from top left corner of the element, horizontal coordinate first. It is also possible to specify some generic positions like:
click in the middle of the screen
The supported positions are:
  1. in the middle of the screenexample
  2. in the top quarter of the screenexample
  3. in the second top quarter of the screenexample
  4. in the bottom quarter of the screenexample
  5. in the second bottom quarter of the screenexample
  6. in the top third of the screenexample
  7. in the bottom third of the screenexample
  8. in the left quarter of the screenexample
  9. in the second left quarter of the screenexample
  10. in the right quarter of the screenexample
  11. in the second right quarter of the screenexample
  12. in the left third of the screenexample
  13. in the right third of the screenexample
  14. in the left side of the screenexample
  15. in the right side of the screenexample
  16. in the top of the screenexample
  17. in the bottom of the screenexample
  18. on the left edge of the screenexample
  19. on the right edge of the screenexample
  20. on the top edge of the screenexample
  21. on the bottom edge of the screenexample
  22. in the left top corner of the screenexample
  23. in the right top corner of the screenexample
  24. in the left bottom corner of the screenexample
  25. in the right bottom corner of the screenexample

Saved values (variables) support

testRigor supports generating random values based on RegEx , saving them and using them later in the test. For example,
generate from regex "[a-z]{10,18}", then enter into "Notes" and save as "actionNotes" //example
validate that stored value "actionNotes" color is "ffaabb" //example
check that "peter" contains stored value "actionNote" //example
click on stored value "actionNotes" //example
check that page contains stored value from "actionNotes" //example
There are 2 special stored values: "username" and "password" which come from Application-specific credentials settings for your test suite. With it you can do:
enter stored value "username" into "username_field" //example
enter stored value "password" into "password_field" //example
These stored credentials are also used by login command. Also, you can use stored variables as parameters in most commands:
enter from the string with parameters "${homePrefix}/my/path" into "urlPath"

example

And calculate expressions like this:
check that expression "${a} + ${b}" itself is equal as a number to "42"

example

testRigor supports ECMAScript 5.1 compatible expressions.
For example, you can calculate to check that a year from 30 days ago is present on the screen:
check that page contains expression "var aDate=new Date();aDate.setDate(aDate.getDate()-30);''+aDate.getFullYear()"
testRigor supports the following pre-defined saved values:
  1. username – example
  2. password – example
  3. homeDomain – example
  4. homeFile – example
  5. homePrefix – example
  6. todayYear – example
  7. todayYearShort – example
  8. todayMonthNumber – example
  9. todayMonthNumberTwoDigits – example
  10. todayMonth – example
  11. todayMonthShort – example
  12. todayDayOfMonth – example
  13. todayDayOfMonthTwoDigits – example
  14. todayDayOfWeek – example
  15. todayDayOfWeekShort – example
  16. nowHour – example
  17. nowHourTwoDigits – example
  18. nowMinute – example
  19. nowMinuteTwoDigits – example
  20. nowSecond – example
  21. nowSecondTwoDigits – example
  22. nowNanosecond – example
  23. nowDateIso – example
  24. nowTimeIso – example
  25. nowDateTimeIso – example
  26. nowMillisecondsFrom1970 – example
  27. nowDateTimeRFC1123UTC – example
  28. nowUnixTime – example
  29. testSuiteParentFolder – example
  30. testSuitePath – example
  31. testSuiteName – example
  32. testCaseName – example
  33. testCaseExecutionLink – example
  34. currentUrl – example
testRigor also supports grabbing values from elements on the screen and saving them into variables for later usage. For instance:
grab value from "some-element" and save it as "my-email"
grab value from input "some-edit" and save it as "my-email"

example

You can set variables directly without entering it anywhere. For instance:
generate from regex "[a-z]{10,18}" and save as "actionNotes" //example
save value "Peter" as "name" //example

Executing actions until condition (loops) support

testRigor has limited support for executing commands until certain condition is true. For example,
click "Next" until page contains stored value "previously generated id"

example

It can be used for going through pages in long lists or scrolling down until certain text is visible or certain button is visible. By default the action will be executed up to 10 times, but you can extend maximum number of times by adding “up to”:
click "Next" up to 12 times until page contains strictly button "Place order"

example

Validations

For UI validations for elements we support (positive and negative):
  1. contains/doesn’t contain (text) – example/example
  2. is blank/is not blank – example/example
  3. matches regex/doesn’t match regex – example/example
  4. has value/doesn’t have value (for inputs/text areas) – example/example
  5. is checked/is not checked – example/example
  6. is disabled/is enabled – example/example
  7. is visible/is invisible – example/example
  8. color is – example
  9. is clickable/is not clickable – example/example
  10. cursor is – example
  11. has CSS class – example
  12. background color is – example
  13. has property – example
  14. has options selected (for selects) – example
check that "element" color is "ffaabb"
check that input "input" has value "value"
check that checkbox "Keep me signed in" is checked
check that checkbox "Keep me signed in" is not checked
Validate that an input has no value:
check that input "input" has value ""
Validate that element has some property:
check that property "background-color" of "my-div" is equal to "black"
check that property "width" of "my-div" is equal as a number to "310px"
check that property "height" of "my-div" is greater or equal than "170"
For stored values, including: API return value validations, values grabbed from the screen, values extracted from text. We support (positive and negative):
  1. matches regex/doesn’t match regex – example/example
  2. contains/doesn’t contain – example/example
  3. is equal to/is not equal to – example/example
  4. is null/is not null – example/example
  5. is blank/is not blank – example/example
You should use the word itself to perform validation on a stored value:
call api "https://testrigor.com" and save it as "variableName"
check that stored value "variableName" itself contains "James"

example
The key to the testing API results is to save it to stored value and then perform validation on stored value itself (with keyword itself) as shown above.

Both element and stored value validations support:
  1. is equal as a number to/is not equal as a number to – example/example
  2. is greater than – example
  3. is greater or equal than – example
  4. is less than – example
  5. is less or equal than – example
You can also enjoy validations that apply to the whole screen/page:
  1. page contains/page doesn’t contain – example/example
  2. page has regex/page doesn’t have regex – example/example
  3. page’s return code is
  4. title is – example
  5. title contains – example
  6. url is/url is not – example/example
  7. url contains/url doesn’t contain – example/example
  8. url starts with/url doesn’t start with – example/example
  9. url ends with/url doesn’t end with – example/example
  10. url matches regex/url doesn’t match regex – example/example
For example, you can combine stored values for validation:
check that url matches regex from the string with parameters "${homePrefix}/product/${type}/[0-9A-Za-z\-]+"

Visual Testing

You can verify visual changes in the screens thanks to Applitools integration or default testRigor screen comparison algorithm. To use Applitools integration you need to configure and enable it first. There is a documentation guide with the steps to do it. If you want to use testRigor proprietary comparison algorithm, then you do not need to do anything.

With Aplitools you can add custom steps like:
compare screens using Applitools
compare screenshots using Applitools
compare screens "Screen Name" using Applitools
compare screens using Applitools treating error as "minor"
compare screens "Screen Name" using Applitools treating error as "major"

If you want to use testRigor proprietary algorithm, you can just omit "using Applitools" part – e.g.,

compare screens
compare screenshots
compare screens treating error as "minor"

The screen name and the severity of the error when the screens mismatched are optional.

You can use the screen name to identify the screenshot in the Applitools application. If you didn’t put the name it will be called as “Image n”, where n is the index of the screen in the test case. For instance, you can use this command 3 times in one test case, this way names would be “Image 1″, Image 2” and “Image 3”.

Regarding to severity parameter, the allowed values are “minor”, “major”, “critical” or “blocker”. The default value is “critical”, which marks the test case as failed.

If Applitools identify a mismatch in the screen comparison, the test case will be marked according to severity and a link to the Applitools report will be provided.

Applitools always compare the current screenshot with itself baseline. You can set the baseline of each screenshot in the Applitools application. If you don’t do it, the first version of each screen would be considered it’s baseline.

Clicking on specific images with visual testing

testRigor also offers visual support for clicking on images by indexing for instances where images or icons do not have a simple way to be referred to. To accomplish this, crop the desired image from a screenshot or file in its full resolution and save it in the Test Data Section. To then refer to it in your case, use the syntax below:
click on the 6th element by image from stored value "logo" with less than "10" % discrepancy
If there is only one image that you want testRigor to recognize, use the following:
click by image from stored value "logo" with less than "10" % discrepancy
You may need to toggle discrepancy percentages in order to allow testRigor to recognize the image.

Working with Tables

You can refer to table cells by the intersection of the row and column by providing value of the first cell in the row and value of the header/top cell in the column. For example, command:
click on table "actions" at row "103" and column "Action"

example
For the table

Actions
# Id Name Actions Additional Data
Filter by
101 york1 Yorktown Arrive Cancel
102 spk2 Spock Listen to Ignore
103 nyo3 Nyota Open channel Promote

will result in a click on “Open channel”.

You can also specify row by saying that row should contain a certain value. This way we will check all values of every row to find the one which matches. For example, for the same table above, and command:
click on table "actions" at row containing "spk2" and column "Actions"

example

will result in a click on the first action “Listen to”. To click on second action “Ignore” you can leverage our context feature:
click on "Ignore" within the context of table "actions" at row containing "spk2" and column "Actions"

example

You can also work with multiline headers by referring to them wither “header” word:
enter "york1" into first table at the second header row and column "Id"

example

testRigor supports tables for all kinds of operations including but not limited to: validations (checks), clicks, hover, entering data (enter … into), drag and drop, etc. Examples:
check that table "actions" at row "102" and column "Name" contains "Spock" //example
check that table "actions" at row "101" and column "Additional Data" has value "Looks like a trap" //example
enter "This is a trap!" into table "actions" at row "101" and column "Additional Data" //example
click "Open channel" within the context of second table at row "103" and column "Action" //example
check that the second table at row containing "Nyota" and column "Action" contains link "Open channel"
click the first button within the context of second table at row containing "Nyota" and column "Action"

Conditional execution

In certain cases, certain elements might appear randomly on the screen. For such cases, there is an if exists clause. For example,
click "element" if exists //example
enter "bla" into "element" if exists //example

the above commands will not fail if element is not found and will be skipped silently.

There is a way to fail at will as in the following example,
fail //example
fail with "error" //example

API Testing

testRigor supports calling to API’s, getting value and saving result as a stored value:
call api <TYPE> "<API_URL>" with headers "a:a" and "b:b" and body "body" and get "JsonPath" and save it as "variableName"
For example,
call api post "http://dummy.restapiexample.com/api/v1/create" with headers "Content-Type:application/json" and "Accept:application/json" and body "{\"name\":\"James\",\"salary\":\"123\",\"age\":\"32\"}" and get "$.data.name" and save it as "createdName"  and then check that http code is 200

example

In the example above, testRigor would validate that return http code is 200. Parameters "JsonPath" and "variableName" are both optional. However, if "JsonPath" is present, "variableName" will be mandatory. Here is one more example,
call api "api" and save it as "variableName"

JsonPath is the way to refer to parts of JSON and described with examples here. If “JsonPath” is not defined in the action, the complete result of the request will be stored in “variableName”.

testRigor supports all HTTP actions for call <TYPE>:
  1. get – example
  2. post – example
  3. put – example
  4. patch – example
  5. head – example
  6. delete – example
  7. options – example
  8. trace – example

testRigor supports multiple headers separated by “and” like so: with headers "a:a" and "b:b"

You can pass JSON into the body of POST message, with double quotes characters escaped like so: “\””. You could use tools like this to escape it for you. For example, and body "{\"name\":\"James\",\"salary\":\"123\",\"age\":\"32\"}"

You can use parameters and multi-line strings for constructing a call:
call api post from the string with parameters "${homePrefix}/api/v1/create" with headers "Content-Type:application/json" and "Accept:application/json" and body text starting from next line and ending with [END]
{
"param": "value",
"param2": "value2"
}
[END] and get "$.data.name" and save it as "createdName"
And you can pass parameters:
call api post from the string with parameters "${homePrefix}/api/v1/create" with headers "Content-Type:application/json" and "Accept:application/json" and body from the string with parameters text starting from next line and ending with [END]
{
"param": "value",
"param2": "${dynamicValue}"
}
[END] and get "$.data.name" and save it as "createdName"
After the API call is executed, if the result was stored into saved value it could be later tested like so:
check that stored value "createdName" itself contains "James"

Uploading files

File upload is supported out of the box. Just use it like the following:
enter stored value "keyName" into input file "fileField" //example
enter "<FILE_URL>" into file input "fileField" //example

Where “fileField” is a file input element, i.e.: input type="file" ... You can upload the file into testRigor store in “Test Data” section, then use it by name as stored value. Alternatively you can use your own URL. If you choose to upload from your own URL, the link should be downloable. In any case the file is uploaded from within testRigor environment.

You can upload a file into an Android mobile device using the following action:
upload file from saved value "sampleFile"
upload file "https://some-page.com/path-to-file" to mobile device
The file will be uploaded into Downloads folder on the device:

Multiple files

Multiple files upload can be done like so:
enter from the string with parameters text starting from next line and ending with [END]
${file_var_one}
<FILE_URL>
[END] into file input "myFileInput"

example

Working with folders

If the input element has a webkitdirectory attribute, e.g. – <input type="file" webkitdirectory ... this element is expecting a folder. If you try uploading a file, we will put it into a temporary folder and enter that value. However, if you want to upload an actual folder, you can zip the folder and use it as an input. In such case, we will unzip the file, preserving directory structure and enter the root path. This is similar to the drag folder action. Note: This does NOT work in headless mode. It also does NOT work with Internet Explorer

Template files

You can also specify files containing comma separated values (CSV) and parameterize those with variables (any stored value) in the form ${nowDateIso}.
The file should be in CSV or TXT format and contain the values and variables in the form:
some value, ${variable1}, another value
${variable2}, fixed value, ${variable3}

example

To allow templating you need to use the word “template” like the following
enter template stored value "keyName" into input file "fileField"
enter template "<FILE_URL>" into file input "fileField"

example

Phone calls

testRigor supports making a call through Twilio . There is a section in the application configuration under Integrations for setting Twilio parameters; it is required for making calls.

After the integration is setup you can add custom steps like:
call "+15344297154" and validate it was picked up //example
make call to "+15344297154" and check it was answered //example
call to +15344297154 //example
call "+15344297154" and check it was completed //example
call "+15344297154" from "+15551234567" and verify it is ringing //example
check that phone call from "+15344297154" is ringing //example
check that phone call from "+15344297154" was answered //example
Number to call from is optional and may need to be allocated prior to using. Numbers to call from and to can be from stored values or parametrised strings:
call from stored value "allocatedNumber" to stored value "answerPhoneNumber"

example

SMS messages (Phone Text)

You can send messages thanks to Twilio integration. There is a section in the application configuration under Integrations for setting Twilio parameters; it is required for sending messages.

Then you can add custom steps like:
sms "+15344297154" with body "this is content" and validate it was sent //example
send sms to "+15344297154" with content "this is content"
send message to "+15344297154" with text "this is content" and check it was delivered //example
send message from +15551234567 to "+15344297154" with text "this is content" and check it was failed
message from +15551234567 to "+15344297154" with body "this is content" and check it was not delivered

Number from which to send message is optional and may need to be allocated prior to using.

You can also check SMS messages and validate and store their contents:
check that sms from "+12345678901" to "+12345678902" contains "Code" and matches regex "Code\:\d\d\d\d" and save it as "sms"
You can then additionally apply extract value command to get just the code:
check that sms to "+12345678902" matches regex "Code\:\d\d\d\d" and save it as "sms"
extract value by regex "(?<=Code\:)[0-9]{4}" from "sms" and save it as "confirmationCode"
Number from, number to, and body can be from stored values or parametrised strings. Additionally, message body may be a multiline string:
send sms from stored value "allocatedNumber" to stored value "answerPhoneNumber" with content from string with parameters starting from next line and ending with <END>
${answerCode} b
<END>

example
You can request a temporary phone number from Twilio . There is a section in the application configuration under Integrations for setting Twilio parameters; it is required for making calls.

After the integration is setup you can add custom steps like:
allocate a temporary number and save it as "newNumber"

This custom step will request a new phone number (Twilio charges will apply) and save it in a variable “newNumber”, which you can use to check for incoming calls or messages. When the test run finished, this number will be released automatically.

Here is an example of testing a 2FA login with SMS:
click "Sign in"
enter "jacob" into "Username"
enter "jacobs-secure-password" into "Password"
click "Verify me"
check that sms to "+12345678902" is delivered and matches regex "Code\:\d\d\d\d" and save it as "sms"
extract value by regex "(?<=Code\:)[0-9]{4}" from "sms" and save it as "confirmationCode"
enter saved value "confirmationCode" into "code"
click "Continue to Login"
check that page contains text "Welcome, Jacob!"

Login support

testRigor supports login with a single command like so:
login

example
This action identifies and performs the necessary steps required to login to the application automatically. After running successfully the first time, it creates a rule named Autogenerated Login for the application containing the identified steps, that you can override by creating a reusable rule with the same name.

For example, for an application with a simple email and password login, the steps executed and included in the rule would be:
enter stored value "username" into "email"
enter stored value "password" into "password"
click "Log In"

Note that login command relies on having login credentials configured for your application on testRigor.

Email testing

testRigor supports testing with both sending emails as well as receiving and validating emails:
send email to "[email protected]" with subject "Test message" and  body "Hi, this is a test, this is just a test message."
check that email from "[email protected]" is delivered

example

Sending emails also supports sending attachments by referencing a URL of a file you’d like to attach:
send email from "[email protected]" to "[email protected]" with  subject "Test message", and  body "Hi, this is a test, this is just a test message.", and attachment from saved value "Sample File"

example

send email from "[email protected]" to "[email protected]" with  subject "Test message", and  body "Hi, this is a test, this is just a test message.", and attachment "http://online.com/file/name.pdf"

example

Notes:
  1. “to” and “from” can be used at the same time. If not specified, “from” address will default to “[email protected]”.
  2. A stored file defined in “Test Data” can be used as an optional attachment. An attachment can also be a link to a file available online without username/password.
  3. Both “from” and “to” addresses can be filled from stored values (e.g., “to saved value “newEmail”” and/or “from saved value “newEmail””)
Checking email will automatically open and render it as an HTML page in a desktop browser window:
check that email to "[email protected]" from "[email protected]stomer.com" is delivered //example
check that two emails to "[email protected]" and "Confirm" in subject were delivered //example
check that one or more emails to "[email protected]" and "Confirm" in subject were delivered //example
check that email to saved value "newEmail" was received //example
check that email to saved value "newEmail" from "[email protected]" and "Confirm" in subject was received //example
check that email to saved value "newEmail" and "<regular expression>" in subject was received
If you need to render the message in the browser of the same mobile device where you test your app of website (if tested in a device), e.g. – when validating a sign up test case, or just want to see how it looks on a small screen, you can mention this in the action like so:
check that email to "[email protected]" and "Confirm" in subject was received and show in mobile

example

In some cases you may need to check that email was not sent, here is how to do this:
check that email to "[email protected]" from "[email protected]" was not delivered

example

Notes:
  1. If the email count is not specified, we assume that only one message is expected. Multiple emails are treated as an error; so in order to avoid receiving the error message, specify the number of emails that should be expected or simply inform the system that more than one can be sent ad done below:
    check that one or more emails to saved value "[email protected]" were received

    example

  2. The user should send a message to the following address: <random-user>@testrigor-mail.com, where <random-user> can be any string. In order to avoid overlap it is recommended that the user handle will contain customer name and some random part, e.g. [email protected]
  3. The user is expected to add some wait time before checking email. This check action will validate delivery, but not wait for the message to arrive. For example,
    wait 2 minutes
  4. Once the action has been executed successfully, the message is deleted from the mailbox and rendered in a new tab. Multiple emails will be marked as error, but each one will be rendered in a separate tab. You can switch between tabs using switch to tab "1", switch to tab "2", etc. Note that old content will stay in the tab before the first rendered email message. In most cases it is tab “1”, unless you opened more tabs.
  5. Each email tab is rendered as an html page, so you can use any actions that you would use on an html page. There are a few useful element ids that will help getting specific parts of an email:
    • “message-froms” a list of “From” addresses (usually one address)
    • “message-subject” subject line
    • “message-date” message sent date and time in Pacific Time zone.
    • “message-tos” a list of “To” addresses
    • “message-ccs” a list of “CC” addresses
    • “message-bccs” a list of “BCC” addresses
    • “message-reply-to” “Reply To” address
    • “message-text” the message text
    • “message-attachments” a list of attachments (file names only)
  6. If you want to check again, you need to re-send the mail. Your custom actions cannot contain multiple “check” actions for the same message.
  7. Multiple recipients can be separated with “and”:
    send email to saved value "newEmail" and saved value "newEmail2" with subject "Test" and body "Hi"

    example

  8. All messages will be deleted after 24 hours, whether checked or not.

Browser cookies, localStorage, sessionStorage, userAgent

The user can set/get/clear browser cookies like this:
set cookie "cookie value" as "cookie-name" //example
set cookie from saved value "variableName" as "cookie-name" //example
get cookie "cookie-name" and save it as "variableName" //example
clear cookies //example
set/get/clear browser localStorage and sessionStorage items like so:
set item "item-data" in sessionstorage as "item-name" //example
get item "item-name" from session storage and save it as "varName" //example
clear sessionstorage //example
set item "item-data" in localstorage as "item-name" //example
get item "item-name" from local storage and save it as "varName" //example
clear localstorage //example
and set/unset a custom userAgent value like this:
set user agent to "My User Agent" //example
unset user agent //example

Comments support

testRigor supports one-line comments separated by // like so:
click "my-cryptic-button" // actually clicks "add to cart"

example

Audio testing

You can test audio by recording it and then comparing it with another recording in the same test or an external file.

Recording

You have the option to record all the audio that is being reproduced in a tab. The command below in an example:
record audio through 10 seconds after clicking "audio-trigger" and save as "my-recording"
You can also record the audio for a specific audio tag as in the example below:
record audio from "my-audio-tag" through 20 seconds after clicking "audio-trigger" and save as "my-specific-recording"

Comparing

After having a recording that is saved as a variable, you can compare it against another recording. For example,
check that audio from "my-recording" is "70%" similar to "my-specific-recording"
You can also compare it against an external file:
check that audio from "my-recording" is "85%" similar to "https://some-page.com/path-to-file"

The supported file extension for external files is .wav

When comparing we can test positive or negative by using similar or different, for example,
check that audio from "my-recording" is "99%" similar to "my-specific-recording"
or
check that audio from "my-recording" is "1%" different to "my-specific-recording"

Playing

If you need to reproduce audio as it was someone speaking through a microphone you could load the .wav that is going to be reproduced from a remote file.

For tests running in linux, virtual devices are used (microphone/speakers) otherwise we attach to existing < audio > tags

You can reference a remote file to download
play audio "https://some-page.com/path-to-file"
Or a reference from test data
play audio "test-data-ref"
If more control about when to play the audio and when to stop it is needed, you can use
play audio "sound-to-play-ref" after clicking "start-recording" then click "stop-recording"

Validating

Is you just need to check that some audio is produced, e.g. – video is playing correctly with sound, you can use the following commands:
check that audio is playing

Negative test is also available:

check that audio is not playing

In both cases a 10 seconds audio sample will be recorded, which will be available in the artifacts for download for manual validation if needed.

SQL Testing

You can use SQL in the steps for getting or inserting rows.

Select

Is going to get the first row and translate each pair of column-name/value into a stored value with the column name as the key:
run sql query "select top 1 UserID, LastName, FirstName from Users;"

example

Then you can use the stored values like:
enter stored value  "FirstName" into "First name"
check that stored value "LastName" itself contains "Doe"

example

Insert

Executes the defined insert statement, for example:
run sql query "insert into Users(UserID, FirstName, LastName) values (3, 'Jon', 'Doe');"

example

Multiple Connections

It’s possible to configure more than one connection. In this case, you can indicate the connection to be used by name:
run sql query "select top 1 UserID, LastName, FirstName from Users;" using connection "connectionName"
Note: If the connection name is not passed, the application will use the first configured.

Overriding the settings

You can update the connection settings at runtime using the following variables: “connectionName:usernameJDBC”, “connectionName:passwordJDBC” and “connectionName:connStringJDBC”:
Save value "user" as "connectionName:usernameJDBC". 
Save value "pass12345" as "connectionName:passwordJDBC
Save value "jdbc:mysql:host:port" as "connectionName:connStringJDBC"
run sql query "select top 1 UserID, LastName, FirstName from Users;" using connection "connectionName"