Page Object Parameterization

Page Object Parameterization Overview

Page Object Parameterization is primarily used for handling multiple parameters and defining new parameters and their corresponding values within the Page Objects to facilitate the easy modification of testing data within a specific test case.

For example, if you have a Page Object representing a login page, instead of hardcoding a specific username and password, you can parameterize the Page Object to accept different usernames and passwords as input. This allows you to use the same Page Object for testing various login scenarios without the need to create separate Page Objects for each scenario.

 

Modify Parameters

  1. Open a Test
  2. Click the Modify Parameters button in the upper right corner of the Page Object


  3. Click Add New Parameter
    ModifyParameter2Modal.png

    1. Select the Step in the Page Object to be parameterized

  4. Select the Attribute for parameterization


  5. Select the appropriate Operator (only for verify actions - it should be left blank for all other actions)
    x
  6. Enter the new associated Value to overload the original value with for this step


  7. Add all Parameters, as needed, and click Save

  8. A message will appear confirming the test case Page Object Parameters has been updated


  9. The new Parameter(s) values will be used in the next test execution
    Note: After executing the test with the new parameters in place, the Browser Results tab will indicate [Parameterized] for any actions with Page Object Parameters. When we hover over the blue highlighted area, we can see the overloaded value.