filmov
tv
Java, Selenium : Creating Page Object Model files for Selenium tests automatically

Показать описание
Those who create Selenium Automated Tests may find, that they do the same steps over and over again when creating the Page Object Model (POM) files.
The steps are like :
1. Moving mouse cursor over the Web Element, whose locator will be stored in the POM file
2. Press Mouse Right Button
3. Select Inspect from the list (usually tha last choice) : the Code Inspector opens
(In the Code Inspector the relevant DOM section will be highlighted)
4. Press Mouse Right button on the highlighted text, a list will come up with the possible locators
5. Select one of the locators.
6. Paste the selected locator to the POM (Java or other) file
7. Make the POM file to be a valid Java file (add the necessary imports, square brackets, etc.)
With the following programm user can copy the locator and create the POM file with only 2 steps :
1. (as above)
2. Mouse Left Button click