This page is maintained for older versions of Rapise only. The latest documentation can be found at: https://rapisedoc.inflectra.com
Learning

Purpose

Objects are the controls and items on the screen of the AUT.  "Learning" an object refers to the process of Rapise collecting enough information about the on-screen item to be able to reference the item when the test script is run without ambiguity and regardless of its location on the UI.

 

Value

When Rapise "learns" an object, it records the object's type, its name and how to find the object again (locator).  It saves everything it learns to the script so that the object can be identified when the test is run.  Rapise gives the object a simple name so that you can easily refer to it later if you decide to modify the script.

 

Usage

Objects are learned in three ways: (1) during recording, (2) explicitly using Learn, (3) using the Spy tool.

 

Recording

During a Recording session, Rapise learns about each object with which you interact.  For details, see Recording.

 

Explicitly

1.

Open the Recording Activity Dialog.  Instructions are HERE.

2.

Place your mouse over the object you wish to learn.  It should become surrounded by a purple box.

3.

Press CTRL+2.

4.

You will see a new entry in the Recording Activity Dialog, signifying that the object was learned.

 

Spy Tool

During a Recording session, you can also click on the Spy button inspect the object hierarchy of the application you are testing. The Spy lets you pick specific objects that might not be visible on the screen, or may be parent/child objects of the one highlighted. When you have found the correct object in the Spy, you can use the Learn button inside the Spy to add it to Rapise's learned object list.

 

The Object Tree

Regardless of how you learn the object, it will be displayed in the Object tree:

 

object_tree_html

 

Each object has various properties and methods / actions that can be performed on it. Expanding the object name lets you see the available functions and properties:

 

object_tree_html_expanded

Everything Rapise learns about an object is saved in saved_script_objects.  You can see this variable defined in the <project-name> objects.js file that will be listed in the Test Files tab of the Rapise.  The following shows what Rapise saved about the "Please enter your name" text box in the TwoDialogs example:

 

      Please_enter_your_name_:{

      "locations": [

              {

                      "locator_name": "Location",

                      "location": {

                              "location": "4.4",

                              "window_name": "param:window_text",

                              "window_class": "param:window_class"

                      }

              },

              {

                      "locator_name": "LocationPath",

                      "location": {

                              "window_name": "param:window_text",

                              "window_class": "param:window_class",

                              "path": [

                                      {

                                              "object_name": "param:object_name",

                                              "object_class": "param:object_class",

                                              "object_role": "param:object_role"

                                      },

                                      {

                                              "object_name": "param:window_text",

                                              "object_class": "param:window_class",

                                              "object_role": "ROLE_SYSTEM_DIALOG"

                                      }

                              ]

                      }

              },

              {

                      "locator_name": "LocationRect",

                      "location": {

                              "window_name": "param:window_text",

                              "window_class": "param:window_class",

                              "rect": {

                                      "object_name": "param:object_name",

                                      "object_class": "param:object_class",

                                      "object_role": "param:object_role",

                                      "x": 222,

                                      "y": 40,

                                      "w": 140,

                                      "h": 23

                              }

                      }

              }

      ],

      "window_text": "Inflectra Rapise Two Dialogs Sample",

      "window_class": "#32770",

      "object_text": "Chris",

      "object_role": "ROLE_SYSTEM_WINDOW",

      "object_class": "Edit",

      "object_name": "Please enter your name:",

      "version": 0,

      "object_type": "Win32Text",

      "object_flavor": "Text",

      "object_library": "Generic"

},

...

 

 

See Also

Recording

Learning invisible  and Simulated Objects is slightly more complicated.  You can find information on both in the Recording Activity Dialog section.  Look for descriptions of the Pick Object button and the _Simulated drop-down menu.