Rainforest Test Language - Actions & Assertions Overview

RTL (Rainforest Test Language) is built on Actions/Assertions and Targets.  Think of them as verbs and nouns.  Click (Action / Verb) on the Red button (Target / Noun)

This article will will discuss Actions/Assertions (verbs) within RTL.  

RTL supports Standard Actions and Custom Actions.

Standard Actions are the building blocks used to build tests.  Actions such as Click, Fill, Navigate which mimic how a human would interact with your site.  
In additional to standard actions there are also assertions such as See, Disappear that are used to validate the state of an element.  

Custom Actions
use several Standard Actions in sequence to build repeatable steps that are used over and over again such as Login, Check Out, Search.  Details on Custom Actions is provided here <NEED TO PROVIDE LINK>.  

Standard Actions Overview

There are over twenty standard actions available, with more becoming available. 

Actions provide half of the information needed.  In addition to the action itself, RTL needs to know the item that the action is being taken upon.  This is referred to as the Target or Element.  Details on Targets is provided here <NEED TO PROVIDE LINK\>.

Standard Actions 

Click
Clicks on a specific element on the page
MODIFIER (optional).  
     
Default - Left
   
 Options - Right, Double
Requires selection of a Target / UI Element


Type
Allows for text to be entered into a selected element  
Type is equivalent to pressing several keys on the keyboard. May be used when a field is already selected (via click) or if you want to trigger an additional keyboard-controlled action.  
Requires a text value
NOTE: prior step needs to be Click for Type to work properly


Fill
Fills text file with specific content you provide.
Combines Click and Type into a single step.  Use Fill to click on something and then type in it such as a search box.
Requires selection of a Target / UI element and a text value 


Press Key
Sends a single key or key combination
MODIFIER (optional).  Additional key that is sent at the same time to modify the action.  To add a modifier, type it into the MODIFIER field.  To use OPTION as a modifier, type "OPTION" into the modifier field.  
Requires a key value
Modifier is optional

Available modifiers:

  • SHIFT
  • CONTROL
  • OPTION
  • COMMAND

Example:
To copy an item - use the following:

  • Press Key = "c"
  • Modifier = type "CONTROL"


Hover
Places cursor over the element
Presumably by doing so causes action on the element such as changing color or activates a drop down menu.
Requires selection of a Target / UI Element


Dropdown Select
Selects a specific item from a dropdown
Combines Hover and Click into a single step.  
Requires selection of two Target / UI Elements:

  • First Target / UI element - Element to click to activate the dropdown
  • Second Target / UI element - Element (option) to select from the dropdown
    NOTE: If the second Target / UI element is not easily visible (long scrolling list), Dropdown Select will not work.


Checkbox Check

Checks (selects) a specific checkbox

Requires selection of a Target / UI Element
When capturing the Target / UI element, two criteria must be met

  • The center of the capture box MUST be over the checkbox you wish to select
  • The capture box MUST capture something unique so it can find the correct box.  Such as text or other element


Checkbox Uncheck

Unchecks (deselects) a specific checkbox
Requires selection of a Target / UI Element
When capturing the UI element, two criteria must be met

  • The center of the capture box MUST be over the checkbox you wish to select
  • The capture box MUST capture something unique so it can find the correct box.  Such as text or other element
    NOTE: when capturing the UI element, the box that is to be unchecked should be selected (CHECKED) during the element capture


Refresh

Refreshes the current page
Refreshes (reloads) the current page.  Nothing else needs to be specified.
NOTE: if there are issues with the site where popups inconsistently appear, using Refresh may help to normalize 


Navigate
Navigates to a specific URL
Requires a specific URL 


Navigate New Tab
Navigates to a specific URL in a new tab
Requires a specific URL 


Navigate Incognito Tab
Navigates to a specific URL in a new incognito tab
Requires a specific URL 


Close Tab
Closes current browser tab


Scroll
Scrolls the current page in specified direction
Use when the requested Target / UI element is not initially viewable (is elsewhere on the page) such as at the bottom.  Used when the page is long and scrolls top / bottom or left / right.

Requires two items:

  • Direction to scroll: UP, DOWN, LEFT, RIGHT (from current position)
  • Target / UI element to locate

Sleep
Pauses action in the automation to ensure that the entire page has loaded or provides time for some other item of the page to complete.  
Example if it takes several seconds to process or place an order - use SLEEP to ensure that those actions have completed prior to moving onto next step.
Requires entry in SECONDS 


Drag and Drop
Drags and Drops an item
Used to select an item and note where the item is to be moved to

Requires two items:

  • Object: Target / UI element to be selected and moved 
  • Target: Target / UI element where the Object is to be moved to 

NOTE: Target screen capture should show what the "drop" area looks like PRIOR to the Object being moved to it. 

Click and Hold
Selects a target and holds it (keeps mouse button down) for set amount of time

Requires two items:

  • Target / UI element to select
  • Time in Seconds to hold


Plain Language (action)
Any action that is not reproducible from above
This would be any item that cannot be broken down into the above actions.  Items such as "Compare A and B", "change the date from today" etc.
NOTE: any test that has Plain Language cannot be executed by automation

Assertions

There are four assertions at the bottom of the actions list.  These are used to validate the current state.  They are similar to an action but are used to check on a target as compared to acting on a target. 

  • See
  • Disappear
  • Loaded
  • Pain Language Assertion

See
Confirms that an element is present.  
Such as a graphic that notes "Congratulations"
Requires selection of a Target / UI Element

Disappear
Confirms that an element is not present.  Opposite of See
Such as a graphic that notes "Congratulations"
Requires selection of a Target / UI Element

Loaded
Confirms that a specific page has loaded
Requires a specific URL 


Plain Language Assertion

Allows for review of current page, state.  

Requires specific instructions to be reviewed by the Rainforest crowd such as make sure the value shown is between 7 and 15.
NOTE: any test that has Plain Language Assertion cannot be executed by automation 



Did this answer your question?