For those who works on the Page Object framework, this chrome extension helps in creating the page object class for Selenium WebDriver with locators for all available elements and methods to access them. It uses a template to generate the class which can be customized from the settings page of the extension.
Selenium Page Object Generator is a good tool to improve the workflow. It will generate Page Object Model on active Chrome tab with a single click, provided that all the options and template are configured. The generated Page Object Model can be saved to pre-configured Chrome download folder.
The template is using Handlebars.js expression, a clean logic-less semantic templating language.
It currently supports 3 different targets: Java, C#, and Robot Framework.
Browser Supported: Chrome 40 or later
You can search for this extension in Chrome Browser. PageObjectGenerator Extension
Once we add this extension to Chrome, we can easily generate Page Objects for the applications which we need to automate.
- Launch Chrome browser and the extension can be found at the top right hand corner.
- Open the application(Lets say facebook.com)
- Now click on the extension of the Page Object Generator.
- We can select the intended language (Java or C# or Robot Framework)
- We can give the Page Name for which it generates the page for us.
- Click on Generate and it does the job.
- This creates .java file with the name which we give in the PageName field with all the controls identified and basic methods written.
This is an early BETA release, it expected to have rough edges, and limited functionality.
This definitely reduces manual involvement, but manual tweak is still recommended.
Happy Automation 🙂