1. Create Maven Project.
2. Create Page Object files.
3. Implement Reusable Utilities and Centralized variables.
4. Write Testcases.
5. Convert Project into TestNG.
6. Implement Data Driving and Parametrizing Practices.
7. Inject Log4j Logging.
8. Build Excellent HTML reports.
9. Integrate with Jenkins.
Create Maven Project
1. Open a command prompt and navigate to the directory we you want to create your new project then type the following command,
Syntax :
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId={maven-template} -DinteractiveMode=false
e.g,
mvn archetype:generate -DgroupId=com.coderzcreed.prathap -DartifactId=E2E -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
2. In order for our Eclipse IDE to detect the maven project we created we need to run the below command inside the project,
mvn eclipse:eclipse
3. Now we need to import the project we created. Open Eclipse then go to File --> Import --> Import Existing Maven Project and click. In the popup window browse and select the project which we created from the earlier steps and hit choose.
You will be presented with the imported project and its details, click Finish.
4. In order to work with Frameworks we must have their libraries in our project. Add the below dependency in pom.xml to import Selenium dependency in the project
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
Add the below dependency in pom.xml to import TestNG dependency in the project
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
Once done your pom.xm will look similar to this snap attached below,
5.