This is a bdd java selenium framework which is using testng, maven, extent report, selenium, java, etc to achieve different tasks.
Project's Java Docs
Sample Test Report
Sample Test Video
Execution Settings
Feature Files
Step Files
- Supports parallel features execution.
- Multiple browsers can be setup.
- Generates report after each run for all test cases with screenshots.
- Record video for failed and skipped test cases.
- Option to auto manage drives using WebDriverManager.
- Option to send report to email (Gmail / Outlook).
- Option to run tests on local or remote.
- Read data from Properties file, Excel, JSON files.
- Real time reporting using ELK.
- Option to run on docker grid, local, zalenium or selenoid.
- On-demand browser instance creation using Dynamic Selenium Grid 4.
- On-demand browser instance creation using Zalenium.
- Run using JenkinsFile.
Below are the component details of the framework:
-
selenium
-
Supports to read and maintain data from multiple file types like:
- Properties File
- Excel File with the help of ApachePOI Jars
- JSON File
-
Cucumber TestNg is used as a unit test framework in order to generate test script taking into account the
Page Object Model
design pattern.All the feature files are in Features
-
Using
maven
, project dependencies are managed. Test can be run usingpom.xml
andtestng.xml
. -
Generates html report automatically by using Extent Report 5. By attaching screenshots and execution videos of the failed test cases.
However, user can set the framework to take screenshots and videos of passed or/and skipped test cases. All reports are generated inreports-test-output
folder. Report automatically opens in default browser.
Note: Exception logs and fail reasons are added to the report as well. All images are in Base64 and videos in mp4. -
Holds common methods to re-use in order to achieve maximum re-usability.
-
- Tests can be executed in parallel and in cross browsers by using:
- pom.xml
- testng.xml
- TestRunner.java
- Jenkins
- Tests can be executed using:
- local browsers
- remote browsers
- docker selenium grid
- selenium grid
- selenoid
- zalenium
- Tests can be executed in parallel and in cross browsers by using:
-
- JavaMail API and JavaBeans(TM) Activation Framework is used to send the test report automatically on email using gmail or outlook. However, user can still decide if report has to be send or not.
Note: Framework allows passwords inBase64Encode
only. - All framework settings are done in properties file, making it easy for a non-technical user.
- User can opt to run the test with their web drivers placed in drivers folder or with WebDriverManager.
- JavaMail API and JavaBeans(TM) Activation Framework is used to send the test report automatically on email using gmail or outlook. However, user can still decide if report has to be send or not.
- Set all the properties/setting in properties file.
- Run pom.xml or testng.xml file.
url
of the test environment.environment
where the test has to be performed.testername
inorder to keep track.downloadwebdriver
to decide if tester want to place the drivers or wants the framework to download it with the help of WebDriverManager.runmode
decides whether to run test cases on local, grid (/ docker-grid), zalenium or selenoid. Accepts yes or no.- if
runmode
is yes then user has to provide the remote url inremoteurl
.
- if
useelk
yes if elk is deployedelksuiteurl
if yes provide the url for kibana
- To delete old report data:
deleteoldreports - to elect if tester wants to delete old reports. Accepts yes or no. numberofdays - if yes than how old the files should be. Value in number of days.
overridereports
to elect if tester want all reports to be merged in one i.e., current reports plus old ones or create new report for each test suite run. Accepts yes or no.- Screenshots:
passedscreenshot - to take screenshot of passed test cases. Accepts yes or no.
retryfailedtestcases
to re-run fail test cases. Accepts yes or no. Not recommended setting to set it as yes.- Email details to send report:
Note: In order to use gmail then enable Allow less secure apps
sendmailafterexecution - to send report. Accepts yes or no. sendmailusing - to choose from gmail or outlook. emailid - sender's email id. emailpassword - sender's password in Base64Encode only. receiversemailid - receiver's email id.
- Setup real time report using ELK:
Note: To use ELK, set the schema to have below keys:
useelk - to enable using real time reporting using ELK. Accepts yes or no. elksuiteurl - url of the elastic search data add.
-
TestName
-
Status
-
ExecutionTime
Note: More fields can be added and changes should be done accordingly in ELKUtils.class
-
- For Jenkins to support extent reporting (or other CSS, etc. components ) run below in scripts
https://jenkisURL/script
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","")
- Uses lombok.