Document toolboxDocument toolbox

Object Spy

Objects are integral part of test automation. Any functional test automation tool simulates user actions required to test a particular case. This simulation has to be accurate.

Consider the simple Login test case. A user wants to test validate login functionality by entering valid user credentials and verifying expected results or application behavior. To simulate this accurately, automation tool has to enter Username in the username field and Password in the password field. The success of the test automation will depend upon the automation tool correctly identifying the 'username' and 'password' fields which has to be done using one of the methods explained above. Test automation will fail in the case of incorrect object identification. 

You have to be careful about the objects that are generated dynamically. Consider the following example:

The Online Railway Reservation System allows you to reserve tickets between two stations. After successful completion, it creates a PNR number and displays in the table as shown below along with a checkbox.

During development of your test case, you will perform one reservation, the system will generate a new PNR (e.g. 123459), and the respective checkbox will be added as an object to select the corresponding PNR row.

Each time you execute this test case, a new PNR is generated along with a new checkbox. This checkbox is generated dynamically and hence its properties are also be dynamic.

For an object which is being generated dynamically for every new reservation, if you fail to specify the correct attribute of the checkbox, your automation tool will refer to the checkbox from the earlier reservation. This is more dangerous from testing point of view as the test case will run successfully after following an incorrect flow.



The procedures described in these sections enable you to add and view objects in repository to be used when developing test cases.

Related topics