-
Notifications
You must be signed in to change notification settings - Fork 3
User Guide
Welcome to the POMBuilder wiki!
This wiki contains documentation for POMBuilder. You can add this extension to Chrome here.
- Right click on the element you want to locate.
- Select
Inspect - Chrome DevTools will open
- Under the
Elementstab, select thePOM Buildertab (it's usually the last tab on the right) - You can click directly on the DOM tree or use the
Identifypointer of Chrome DevTools to select your desired element - In the
POM Buildertab, Smart Gen recommends the best locators for the selected element. - Click the
Copybutton next to a locator to copy its value - Click the
Findbutton next to a locator to test it. - If you see that the Locator Test returns 1/1 (the locator uniquely identifies the element), you're safe to use that locator. Copy it to the corresponding page object in your test project (Protractor, Selenium and TestArchitect).
- If the Locator Test returns 0/0 or 1/X (the locator doesn't retrieve any element or the locator points to multiple elements), you must refine the locator until it returns 1/1
- Right-click on the element of interest
- Select
POM Builder – Quick Copy> ** There are 3 options available: *** Suggested Locator: the most reliable locator as recommended by POM Builder. You should use it for better performance and stability. It could be a single attribute, a CSS Selector or an XPath locator. *** CSS Selector: A CSS Selector that uniquely identifies the selected element *** XPath: An XPath locator that uniquely identifies the selected element - After making your selection, the selected locator will be saved in the clipboard
- Feel free to paste it anywhere you want
Currently, POM Builder supports 4 types of output:
- Raw Value: A raw value of the element locator
- Protractor: A locator template written in Typescript for Protractor projects
- Selenium Java: A locator in the standard Java syntax used to locate elements in Selenium
- TestArchitect: An interface element used in TestArchitect
If you are using another test framework which has a different syntax, you can add a new output template, e.g. driver.findElement(webdriver.By.%type(%value)) in which %type and %value are the macros for the locator type ('Id') and its value ('someID') respectively. Remember to put them in your template for a valid locator output.
EXAMPLE Let's say you're using selenium-webdriver to write your Selenium tests in Javascript, and you have to define your element locators frequently as below:
To save time, you could take advantage of POM Builder Template Configuration feature to define your customized output template.
-
Open
POM Buildertab in Chrome DevTools -
Click the button
-
In
Template Configuration, clickAdd New -
Create a new output template named
Selenium JSwith the following information. Note that%typeis the macro for the locator type and%valueis the macro for the output value.
-
Review the
Example Resultvalue to check whether your defined output is valid then clickApplyto save the new template -
Selenium JSwill appear in the Output dropdown list.
- Select it then copy a locator. The locator will be copied to clipboard in your pre-defined template.
- When you paste it to any editor, you'll see something like the below.
driver.findElement(webdriver.By.id(identifierId))
POMBuilder Developement Team
- Address: 1730 S. Amphlett Blvd. Suite 110, San Mateo, CA 94402, USA
- Email: pombuilder@logigear.com
- Phone: +1 650 572 1400
- Group: https://www.facebook.com/groups/pombuilder/



