Rainforest Automation - Actions & Assertions Overview
RFA (Rainforest Automation) 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 discuss Actions/Assertions (verbs) within RFA.
Standard Actions are the building blocks used to build tests. Actions such as Click
, Fill
, and Navigate
which mimics how a human would interact with your site.
In addition to standard actions, there are also assertions such as See
and Disappear
which are used to validate the state of an element.
##Advanced technique to test and uploaded file on Google
Embedded Tests
Embedded tests for RFA function the same way that traditional Rainforest embedded tests. Any test created in RFA may be embedded into any other RFA test. See Embedded Tests in Automation for additional information.
Embedding a test is beneficial for steps that are used in several tests, such as logging in, creating an account, etc.
NOTE: If you had previously used custom actions, those tests are still available for embedding.
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, RFA needs to know the item that the action is being taken upon. This is referred to as the Target or Element, which are images matched on a grayscale.
Note: Image matching is done using grayscale. Grayscale is used so the imaging matching is more resilient. Color matching cannot be reliably tested today. If specific color matching is necessary for the test, RFA should not be used.
Standard Actions
Click
Clicks on a specific element on the page
MODIFIER (optional)
Default - Left
Options - Right, Double
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) and copy/paste will not work.
Fill
Fills text field 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
A Key is always a single actual key. Along with examples such as a, b, c, 1, 2, 3 the following are also acceptable:
CapLock
, Tab
, ArrowDown
, ArrowUp
, ArrowLeft
, ArrowRight
, PageDown
, PageUp
,
Escape
, Home
, End
, Delete
Backspace
- when in a text box, deletes one character from the current cursor location
Enter
- please use Enter instead of Return
NOTE: Each name currently has to be entered into the UI exactly as spelled above;
CamelCase is expected (i.e. no spaces and the first letter of each word capitalized).
The Modifier is an additional key that is used at the same time to modify the action. It is optional and should be left blank if not needed. Common modifiers are: Control, Alt, Tab, Shift.
The modifier Command can be used for MacOS tests.
The modifier Super can be used on Windows tests to act as the Windows key.
Some common examples:
ACTION | KEY | MODIFIER |
---|---|---|
New Tab | t | Control |
Copy | c | Control |
Paste | v | Control |
Open File | o | Control |
Focus Next | Tab | |
Focus Previous | Tab | Shift. |
! | 1 | Shift. |
M | m | Shift |
NOTE: Currently does not support three key combinations such as Control
+ Shift
+ Delete
combo
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 another 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 in the current tab
Navigate New Tab
Navigates to a specific URL in a new tab
Navigate Incognito Tab
Navigates to a specific URL in a new incognito tab
Close Tab
Closes current browser tab
Scroll
Scrolls the current page in a specified direction
Used when the requested Target / UI element is not initially viewable (is elsewhere on the page) until scrolled.
Requires two items:
- Direction to scroll: UP, DOWN, LEFT, RIGHT (from current position)
- Target / UI element to locate
Note: The Scroll action conducts up to 25 scrolls. An alternative is to use Press Key actionsEnd
orPageDown
to reach the target.
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.
For example, if it takes several seconds to process or place an order - use SLEEP to ensure that those actions have completed prior to moving on to the next step.
Drag and Drop
Drags and Drops an item
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 producible 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.
Requires selection of a Target / UI Element
Disappear
Confirms that an element is not present (opposite of See)
Requires selection of a Target / UI Element
Loaded
Waits and confirms for the page to fully load.
Plain Language Assertion
Allows for review of current page or state
Requires specific instructions to be reviewed by the Rainforest crowd, such as "Does the delivery date show tomorrow's date?"
NOTE: any test that has Plain Language Assertion cannot be executed by automation
If you have any questions, please feel free to reach out to us at [email protected] or through Intercom!
Updated 7 days ago