This is a java appium framework which is using testng, maven, extent report, appium, java, etc to achieve different tasks.
Project's Java Docs
Sample Test Report
Sample Test Video
Execution Settings
- Appium server will start and stop automatically with different ports.
- Each device's capability file will be created automatically.
- Capability Template File will be used to generate actual capability files for each device.
- Supports parallel testing (for parallel="tests" in testng.xml).
- Multiple devices can be attached to machine.
- Generates report after each run for all test cases with screenshots.
- Record video for failed test cases.
- 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, or existing appium server.
- On-demand browser instance creation using Dynamic Selenium Grid 4.
- Run using JenkinsFile.
Below are the component details of the framework:
-
Supports to read and maintain data from multiple file types like:
- Properties File
- Excel File with the help of ApachePOI Jars
- JSON File
-
TestNg is used as a test framework in order to generate test script taking into account the
Page Object Model
design pattern. -
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
- Jenkins
- Tests can be executed using:
- real devices
- remote devices
- emulators
- 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
in order to keep track.ip
ip where appium is set up.appiumjs
path to main.js (e.g., %APPDATA%/npm/node_modules/appium/build/lib/main.js)nodejs
path to node executable (e.g., C:/Program Files/nodejs/node.exe)apppackage
app package name.appactivity
app activity name.appname
app name.runmode
decides whether to run test cases on existing appium server, local, grid (/ docker-grid). Accepts yes or no.- if
runmode
is yes then user has to provide the remote url inremoteurl
. - if
runmode
is local then provideip, appiumJS, node executable
.
- 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.java
-
- 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.
- Appium server logs will be stored in logs folder with name currentThread.txt if there is an error.
- All capabilities file will be stored in capabilities folder with name deviceUDID.json.