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
    Parameterize 1 img.png


  3. Click Add New Parameter
    ModifyParameter2Modal.png
  4. Select the Step in the Page Object to be parameterizedModifyParameters3SelectStep.png

  5. Select the Attribute for parameterization
    ModifyParameter4Attribute.png

  6. Select the appropriate Operator
    ModifyParameter5Operator.png
  7. Enter the new associated Value to overload the original value with at this step
    ModifyParameter6Value.png

  8. Add all Parameters, as needed, and click Save
    ModifyParameter7Save.png

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


  10. 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.
    ModifyParameter9PostExecution.png