Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Objects are an 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 username field and Password in password field. The success of the test automation will depend upon the automation tool correctly identifying the 'username field' and 'password field' fields which has to be done using one of the methods explained above. Test automation will fail if these unique objects are not identified correctly.

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

Online Railway Reservation which System allows you to reserve tickets from the source station to the destination station. After successful completion, it creates a PNR no. number and it is displayed in the table as shown below along with a checkbox. Image Removed


Image Added
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.
Image Removed Image Added
Each time you execute this test case, a new PNR will be is generated along with a new check boxcheckbox. This check box checkbox is dynamically generated and hence its properties will 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 but by after following an incorrect flow.
Image Removed Image Added