Learn AI Based Test Automation Using Open Source
In this online learning program, I share with you step by step approach how to perform self-healing-based test automation using Healenium Open-Source Micro service-based automation project released recently by the EPAM team.
​
First, understand why EPAM introduce the concept of self-healing in test automation?
A detailed blog published on the Self-Healing concept in 2019, you can revisit the blog again to understand the self-healing concept in test automation.
Here is Blog URL:
Healenium project was developed based on the concept of Web Scalping.
For any test once configured to use the Healenium web driver instance, the Healenium web client first sends a request to the Healenium backend server at run time.
Healenium backend server once receives the request from the Healenium web client starts building DOM for each web locator as part of test execution.
​
Later, DOM information for each parsed web locator is stored in Postgres data tables integrated with the Healenium backend server.
In case of no such web element exception is thrown by the selenium test script, Healenium in build Machine Learning algorithm triggered and finds the best possible web locator match for broken locator using tree-based machine learning algorithms developed in-house at EPAM.
Here is Healenium backend architecture diagram:
Workflow sequence for Healenium-based test execution is as below:
-
The test Class method sends a request to the Healenium web client to find a web element.
-
The Healenium web client sends a request to the Healenium backend server to store the locator path in case the web element locator is discovered successfully.
-
If no such element exception occurred, it re-generates the DOM for available web elements on the web page and compares each web element DOM with the DOM of a web element that is not available. Based on the score assigned for each comparison, the tree-comparing supervised machine learning algorithm shortlists the highest possible match as part of healed web locator.
-
Locator path for both healed locator and failed locator published in the Healenium report once the test execution is complete.
Currently, Healenium project is divided into multiple parts:
-
Healenium Frontend - Healenium web
-
Healenium Backend - Healenium backend contains:
-
postgres-db (PostgreSQL database to store web locator path, web locator type, healing report parameters like Web Page URL, Healing to be set as True or False for each web locator)
-
hlm-proxy (Proxy client request to Selenium server)
-
hlm-backend (CRUD service)
-
selector imitator (Convert healed locator to convenient format)
-
selenoid/selenium-grid (Selenium server)
Detailed block diagram as below:
Now, I build each component of Healenium backend step by step in the sequence:
​
Step 1:
PostgreSQL Database installation, Configuration for Healenium database user, and schema creation.
​
Step 2:
Run hlm-backend as spring boot application that connects with database using NGA written configuration file without initializing docker container. Make sure all required software's installed before starting the hlm-backend server application
​
Step 3:
Run Selector Imitator service written in Python and holds tree comparing algorithm.
​
Step 4:
Run Selenium Grid server in standalone mode.
​
Step 5:
Run the Hlm-proxy service using NGA written configuration file without initializing the docker container.
​
For the benefit of NGA members, I am going to share the download path for each project that I have used for running Healenium on my local machine.
​
Step 1: PostgreSQL Database installation
​
You can download the executable from the below path and install pgadmin on your local machine. Keep the root admin password as root only.
Download URL:
https://www.enterprisedb.com/software-downloads-postgres
I have used the 15.2.2 Windows 64-bit version. But you can download any latest available version from the download link.
Once you are done with the installation as per on-screen instructions, you will get the user admin panel after launching pgAdmin 4 application from your local machine as below:
​
Subscribe to entire learning program in just 999 INR (80 Percent discount).
Original Price: 5000 INR
​
To purchase Learn AI Based Test Automation subscription, Scan below QA Code.
Once done with payment, send payment screenshot at trainings@nextgenerationautomation.com.
As paid member, you will get access to entire learning program that lets you build all the microservices independently using NGA in house customized jar files and configuration files.
Paid members can browse entire learning program, clicking below URL:
​
Learn AI Based Test Automation using Open Source (Paid members link)
Internal Adevrtisement
Snapshots from Paid Learning program as below:
​
Here is a combined snapshot for 4 services that deployed successfully before triggering AI Enabled test automation scripts in your project.
If you have reached here, Congratulations you have successfully deployed Healenium in your local machine and added a new skill to your job profile:
​
How to perform AI Based Test Automation using Open Source?
​
Next, I walk you through how to run the test, perform self-healing and generate the Healenium test execution report. The report contains web locators that healed by Healenium machine learning algorithm at run time
​
Download the sample test automation project here:
Once you download and unzip the project, open the project in Eclipse IDE as below:
Internal Adevrtisement
Build the downloaded Sample test automation project with commands:
mvn clean
mvn install -DskipTests
Run CssTest Class as JUnit Test. Once the test gets executed Healenium APIs will apply self-healing at run time for web locators that are not available on the web page and update the failed locators with the valid locators.
CSS Test Class once executed will generate the report as below:
​
Report URL:
http://localhost:7878/healenium/report/
Report URL:
http://localhost:7878/healenium/selectors/
With this, I have reached the end of the online learning program
Learn AI Based Test Automation using Open Source
​
I hope you find the shared information useful and can be applied to your test automation project.
Ankur C
Founder, Next Generation Automation
About the Author:
Next-Generation Automation was founded by Mr. Ankur Chaudhry in the year 2018 with the vision of Building better QA for tomorrow.
​
Mr. Ankur Chaudhry holds a Bachelor of Engineering in Electronics and Communication from Thapar University, Patiala, Punjab, India. (1999 Batch Pass out).
He holds 20 years of strong IT work experience in Quality Assurance that including both Manual tests and Automation. Before Next Generation Automation he worked with MNCs like Wipro Technologies, Capgemini, Samsung Electronics, and JP Morgan Chase where he contributed significantly to building the best quality enterprise applications both for clients and in-house with his manual and automation test skills.
​
At Next Generation Automation, Ankur is running Overseas Hiring Model for QA Engineers that connects QA Engineers with Overseas Employers based across the EU and UK region.
​
For more details, about EU Overseas Hiring Model from Next Generation Automation,
Visit the below URL:
EU Overseas Hiring Model | Next Generation Automation
​
For more details, about UK Overseas Hiring Model from Next Generation Automation,
Visit the below URL:
UK Overseas Hiring Model | Next Generation Automation
​
Also, As QA Engineer you can develop Enterprise level test automation skills with his learning program, Visit the below URL:
Learn Enterprise Level Test Automation | Next Generation Automation