Web automation testing using Selenium, Cucumber, Java, design pattern Page Object Model (POM) with Page Factory, and TestNG library for parallel testing.
This automation support:
- Run same scenarios using 1 web driver.
- Run different scenarios using 1 web driver.
- Run same scenarios using more than 1 web driver.
- Run different scenarios using more than 1 web driver.
This automation created using POM design pattern. What is POM? POM stands for Page Object Model. POM is a design pattern used to make automation. Where each page an application or website is used as its own class. This gives an advantage when one of a page's interface changes, then other classes will not be affected.
Then for Scenario scripting, we will use Cucumber and Gherkin.
What is Cucumber? What is Gherkin?
Cucumber is a tool that supports BDD (Behavior-Driven Development).
Gherkin is a set of grammar rules that makes plain text structured enough to be understood by Cucumber. Scenario scripts are written using Gherkin.
Ref: https://docs.cucumber.io/docs/guides/overview/
Items | Remarks |
---|---|
Editor | Intellij IDEA Community (https://www.jetbrains.com/idea/download/#section=windows) |
JDK | JDK 8 (https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html) |
Web Driver | Chrome Driver (https://chromedriver.chromium.org/downloads) Firefox Driver (https://github.com/mozilla/geckodriver/releases) |
Browser | Chrome/Mozilla Firefox/Edge latest version |
Install Editor Intellij Idea Community and JDK.
- Right-click My Computer > Properties > Advance system settings > Environment Variables > PATH > Edit
- Type
C:\Java\java-8\bin
- Click Save
Automatically set itself
Clone this repository through terminal or command prompt.
Open this automation using Intellij IDEA.
- Click File > Project Structure
- Make sure JDK 8 is selected in Project SDK
- Klik Preferences > Plugins
- Search using keyword
cucumber for java
- Click Install
- Repeat steps 2-3 for plugin
gherkin
|-- test
|-- java
|-- utils
|-- runners
|-- pages
|-- setups
|-- steps
|-- resources
|-- features
|-- webdriver
utils
package for other required classpages
package for all page classes.setups
package for all automation configuration.steps
package for all page step definitions.resources
package for all features or non java classes.runners
package for Runners class that called from testng xml for run the parallel testing
First Way:
- Open browserList.xml and run it.
Second Way:
- Using terminal or cmd, type
mvn test