Create a Maven Project
1. Create new Maven Project
-> Maven - new Project - maven-quickstart - GroupID + ArtifactID
2. Add all Dependencies in pom.xml
Add from Maven Repro: Selenium & TestNG
3. Create Base and utility functions
Create base Class in main/java & add Browser Invocation
- create a resources Package in main/java
- create a file "data.properties" to store data in a central place store things like
browser = chrome
- envoce it in the base.file
Propertiesprop=Properties();FileInputStreamfis=newFileInputStream("//home//helloworld//Documents//Code//Ecplise//SampleProject//E2EProject//src//main//java//SampleProject//data.properties");prop.load(fis);Stringbrowsername=prop.getProperty("browser");
Find absolute path of data.properties in rightclick Properties
put it in the FileInputStream
if(browserName=="chrome"){System.setProperty("webdriver.chrome.driver","C://home//helloworld//chromedriver");driver=newChromeDriver();}elseif........// instead of former implicitly Wait:newWebDriverWait(driver,Duration.ofSeconds(10));returndriver;
4. Organizing Page objects
- Adding Tests
- Datadriving/ Prameterizing Tests
- Converting into TestNG Framework
- TestNG Listeners
- Screenshot on Test Failures
- Creating Excellent HTML reports for Test Results
- Jenkins Continuous Integration
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse