I used the technologies below:
- Selenium: It is for automating web applications for testing purposes, but is certainly not limited to just that;
- Java: Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers. Java offers the rich user interface, performance, versatility, portability, and security that today's applications require;
- Page Objects: Page Objects help you write cleaner tests by encapsulating information about the elements on your application page. A Page Object can be reused across multiple tests, and if the template of your application changes, you only need to update the Page Object;
- Page Factory: age Factory in Selenium is an inbuilt Page Object Model framework concept for Selenium WebDriver but it is very optimized. It is used for initialization of Page objects or to instantiate the Page object itself. It is also used to initialize Page class elements without using "FindElement/s."
- Cucumber: Cucumber is a tool that supports Behaviour-Driven Development (BDD) - a software development process that aims to enhance software quality and reduce maintenance costs.
test/javafeaturesWhere feature files should be createdAccount.feature
PagesWhere the page object of tests should be createdAccountPage
StepDefinitionsWhere the specification of tests should be createdHooksRun before or after each scenarioAccountStep
UtilsWhere the helpers can be created and classes methods to reuse.HelpersThis class is responsible to create methods to reuse, waits and etc.ConfigFileReaderThis class is responsible to read the config.properties.TestRunner
test/resourcesIt is responsible to keep the drivers and properties files.
- Install Java Development Kit (JDK);
- Set up the variable JAVA to MAC, Windows, and Linux;
- Install Maven
- Run
mvn cleanclean the project - Run
mvn compilecompile the source code of the project
-
Donwload the driver to your OS
-
Unpack the driver in this folder
src/test/resources -
If you are using Windows, you should change the
line 19on the filesrc/test/java/StepDefinitions/Hooks.java
System.setProperty("webdriver.chrome.driver","src/test/resources/chromedriver.exe");
- Run
mvn testtest the compiled source code using a suitable unit testing framework. It will be generated a report that can access by the link on the terminal after run all tests. e.g.: https://reports.cucumber.io/reports/{key}