Documentation

Looking for something in particular?

Automation V3: Refactoring Page Objects

Overview

Earlier, renaming a Page Object or moving it to a different folder required manually updating all references across affected test cases. This increased the risk of broken links, execution errors, and added maintenance overhead.

The refactoring of the Page Objects in Provar Automation V3 (Version 3.0.4 release) ensures that renaming or moving Page Objects does not require users to manually update references within test cases. The system automatically manages updates to Page Object names and package paths, maintaining consistency and preventing test failures. This enhancement eliminates those manual steps and ensures seamless refactoring of Page Objects across the project.

Key Improvements in Page Objects Refactoring

  • Automatic Updates on Rename – When a Page Object is renamed, all references in test cases are updated automatically. Users no longer need to search for and manually update broken links.
  • Seamless Page Object Movement – If a Page Object is moved to a different folder:
    • The package name inside the Page Object file is automatically adjusted to match the new location.
    • All test case references adapt to this change to remain intact and functional.
  • Zero Manual Maintenance -These improvements eliminate tedious manual updates, reduce the risk of errors, and ensure that all legacy and existing test scenarios continue to work without impact.

How Page Object Refactoring works

Provar now offers enhanced handling as mentioned below:

1. Page Object Renaming

  • When a Page Object is renamed, Provar automatically updates all references of that Page Object across test cases.
  • No manual intervention is needed.
  • All linked test steps continue to work without disruption.
Fig: Snapshot displaying renaming of a Page Object.

2. Page Object Movement

  • When a Page Object is moved from one folder to another:
    • The associated package name is automatically updated in the Page Object file.
    • All references inside test cases remain valid and functional.
  • Test cases continue to run without errors or broken links.
Fig: Snapshot displaying moving a Page Object.

Page Object Drag and Drop

  • When a Page Object is dragged from one folder and dropped to another folder:
    • This will work the same as performing move operations from the context menu.
    • The associated package name is automatically updated.
  • Test cases continue to run without errors or broken links.

Users are not required to modify any references after refactoring actions. Test cases referencing the Page Object will continue to work without interruption. Legacy test scenarios remain unaffected.

Note: The refactor functionality as mentioned above for Page Objects is also applicable to all Java files created within the Custom API’s folder and supports the rename and move operations to update the references throughout the project.

Fig: Snapshot displaying moving a Page Object.


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top