Learning

Top  Previous  Next

Purpose

Objects are the controls and items on the screen of the AUT.  "Learning" an object refers to the process of SmarteStudio 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 SmarteStudio "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.  SmarteStudio 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 two ways: (1) during recording or (2) explicitly.

 

Recording

During a Recording session, SmarteStudio 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.

 

Everything SmarteStudio 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 SmarteStudio.  The following shows what SmarteStudio 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": "SmarteSoft SmarteStudio 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.
Learn Object