-
Notifications
You must be signed in to change notification settings - Fork 1
Using POM
Simon Sai edited this page Sep 26, 2024
·
15 revisions
- Compared to common steps, steps within the Page Object Model (POM) are easier to maintain.
- Here's how you can build a scenario using POM.
-
Write your steps in business language:
-
Create
HomePage
class for google project -
Create
PageGenerator
for google project -
Create
GoogleSearchSteps
for feature search -
Define your first step
- In
GoogleSearchSteps
, define a step as shown below. - If done correctly, the warning for the step in the feature file will disappear.
- Once you've defined the first step in GoogleSearchSteps, you can use Quick Fix to easily add more definitions.
- Define search method in HomePage
- In
HomePage
, you need to create locators for each element you want to interact with. - After that, simply use the method in your step definition.
- Don't be afraid to get creative and make mistakes along the way.
Finish