A nimble and flexible Selenium Page Object Model generator to improve agile testing process velocity.
The template is using Handlebars.js expression, a clean logic-less semantic templating language.
This is an early BETA release, it expected to have rough edges, and limited functionality. It currently support 2 different targets: Java & Json
(You need to use Chrome 40+ to try this out)
- To install this plugin download the CRX file from here. Open chrome://extensions/ in your chrome browser and drag and drop the downloaded CRX file to install the Plugin.
You will need to install Node.js as a local development dependency. The npm
package manager comes bundled with all recent releases of Node.js
.
npm install
will attempt to resolve any npm
module dependencies that have been declared in the project’s package.json
file, installing them into the node_modules
folder.
$ npm install
To build the sources into corresponding packages, run:
$ npm run build
The /build
folder and /dist
folder are created. All built files are placed in the build
folder, and the distribution ready packages are placed in dist
folder.
To make sure we did not break anything, let's run:
$ npm test
Once the changes are in-place and ready for distribution, update package.json
with new version, and run:
$ npm run build
The /dist
folder will contain distribution ready packages.
Note : When ever page object need to be generated, please enable this plugin. Disable this plugin once page object is generated
Open the Page for which page object need to be generated. Right click the html elements in the page to add those html elements into page objects. Once a html element is right clicked, a dialog box will open to get the name of the locator. Once the name is entered the locator information is added to the plugin. This way we can add all the important html elements in the current page to page object.
We have one more option to add html details to the current page object in addition to right clicking the html elements. Once Add button is clicked, a popup will open to get locator details and verify whether html element with the locator specified is available in the current page and then add the correcponding html element details to current page object.
Once all the html elements are added, we can generate page object code snippet by clicking "Generate" button. Currently we can generate page object with Java and Json.
We can also link Git repository to directly check in the generated page object code snippet. For this Git repository details need to be provided. This can be done by clicking "Options" button in the Plugin.
In the Options Page we need to fill Git repository details like repo path, user name and key with write access to that repository. Also git commit details like default message, name & email need to be provided. Once these configuration details are provided, we can directly push the newly generated page objects to the Git Repository.
Also when using this option, Using "Find Page" button, we can check and load Page objects that are already created previously for the current displayed page, if it is already available in the linked Git Repository. This feature will help in
- find out the page objects that are already created for the current displayed page.
- Update or Modify already page objects with the Chrome Plugin itself.