SlideShare a Scribd company logo
Optimizing Test
Execution:
Heuristic Algorithm
for Self-Healing
Nidhi Yadav (Automation Consultant)
Test Automation Competency
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
 Punctuality
Join the session 5 minutes prior to the session start time. We start on
time and conclude on time!
 Feedback
Make sure to submit a constructive feedback for all sessions as it is very
helpful for the presenter.
 Silent Mode
Keep your mobile devices in silent mode, feel free to move out of session
in case you need to attend an urgent call.
 Avoid Disturbance
Avoid unwanted chit chat during the session.
1. Introduction
 Challenges of Traditional Test Execution
 Importance of Optimized Test Execution
2. Understanding Self-Healing
 Overview
 How Self-Healing works?
3. Heuristic Algorithm for Self-Healing
§ Defining Heuristics for Self-Healing
§ Best Practices
4. Types of Heuristic Algorithms
Adaptive Locator Recovery Algorithm
LCS based Algorithms
Annotation Based Locator Algorithm
Retry Mechanisms
5. Demo
6. Q/A
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Challenges of Traditional Test Execution
Test execution is the process of running tests on software applications to
ensure their functionality, performance, and reliability.
 High Maintenance Efforts: Frequent application changes require constant
updates to test scripts, diverting focus from critical activities.
 Frequent Test Failures Due to Minor Changes: Minor application updates
cause test scripts to fail, leading to false positives and complicating issue
identification.
 Time-Consuming Debugging Processes: Manual and complex issue
identification delays feedback to developers and slows the release cycle.
 Lack of Adaptability: Static test scripts miss bugs due to inability to adjust
to dynamic application changes, compromising reliability
Importance of Optimized Test Execution
Enhanced Efficiency
Optimized test execution ensures that test
processes are streamlined, reducing the time
and effort required to run tests.
Better Test Coverage
Comprehensive testing ensures that more
aspects of the application are verified, reducing
the risk of undetected bugs and improving
software robustness helping QA teams to
achieve broader and deeper test coverage.
Improved Reliability
By minimizing false positives and negatives,
optimized test execution increases the
accuracy of test results. Reliable tests ensure
that real issues are identified and addressed
promptly.
Enhanced Adaptability
allows test scripts to adapt quickly to changes
in the application ensuring that testing remains
relevant and effective even as the application
evolves
02
Overview
 Self-Healing, the automation of test automation, recognizes changes in
the “system under test” and automatically adapts the test execution
during runtime so that the tests remain functional.
 Whenever a test is executed, such algorithms conduct a thorough
search of the application's UI for any pre-existing objects.
 The results are then compared to the model of the application used in
the automated tests.
 If any modifications to the application are detected, there is a capability
that allows tests to be modified automatically.
How Self-Healing works?
03
Overview
 Heuristics are methods that use shortcuts to find solutions quickly.
 Known as Approximate Algorithms: approximate rather than precise, providing near-perfect solutions within a given timeframe.
 Why Heuristics?
Best Practices
Carefully Design and Test Heuristic
Clearly Define the Scope of Self-Healing
Rollback Mechanisms
Monitor and Refine Self-Healing Behavior
Start Small and Scale
Incrementally
04
Adaptive Locator Recovery Algorithm
 Sophisticated heuristic approach designed to enhance the reliability
and robustness of automated testing.
WebElement element = searchByVisibleText(driver, locatorKey);
if (element != null) {
System.out.println("Element found using visible text heuristic.");
return element;
}
WebElement element = searchByNeighboringElements(driver, locatorKey);
if (element != null) {
System.out.println("Element found using neighboring elements heuristic.");
return element;
}
WebElement element = searchByRegex(driver, locatorKey);
if (element != null) {
System.out.println("Element found using regex heuristic.");
return element;
}
Adaptive Locator Recovery Algorithm
USE CASES:
Longest Common Subsequence (LCS) Algorithm
 This algorithm, considers the weight of various attributes such as tag, id, class, value, and others.
 It identifies the longest sub-sequence that is common to all sequences in a set of sequences.
Longest Common Subsequence (LCS) Algorithm
 Healenium is an open-source library for automated testing that leverages the power of machine learning (LCS algorithm) to improve
the reliability and resilience of tests.
 Improves stability of Selenium based tests.
Annotation Based Locator Algorithm
 The ABLA algorithm capable of testing a website and restoring locators in case they are broken.
 When the node id, class or another attribute is changed, special attributes are used to tag nodes maintaining the previous values.
 ABLA Algorithm:
1: for locatorList do
2: attribute = getLocatorAttribute(locatorList, i, 0)
3: value = getLocatorValue(locatorList, i, 1)
4: node = executeLocator(attribute, value)
5: if node != null then
6: executeTest(node)
7: else
8: newNode = findNewNode(attribute, value)
9: if newNode != null then
10: newNodeAttr = getNewNodeAttr(newNode)
11: newNodeValue = getNewNodeValue(newNode)
12: restoreLocator(locatorList, attribute, newNodeValue, i)
13: executeTest(newNode)
1: param1: attribute
2: param2: value
3: if attribute == ”id” then
4: node = findNode(”prevId”, value)
5: else if attribute == ”class” then
6: node = findNode(”prevClass”, value)
7: else
8: node = findNode(”preva”+attribute, value)
9: if node == null then
10: node = findNode(attribute, ”prevv”+value)
11: return node
findNewNode function:
Annotation Based Locator Algorithm
 USE CASES:
Retry Mechanisms
 Such mechanism automatically retries a failing action a limited number of times using interfaces like IRetryAnalyzer .
 Helpful for intermittent failures caused by network issues or temporary glitches.
 Using the retryAnalyzer attribute in the @Test annotation
@Test(retryAnalyzer = Retry.class)
public void testLogin() {
}
package retryMechanism;
import org.testng.IRetryAnalyzer;
import org.testng.ITestResult;
public class Retry implements IRetryAnalyzer {
private int maxRetryCount = 2; // Define the maximum number of retry attempts
private int retryCount = 0;
@Override
public boolean retry(ITestResult result) {
if (retryCount < maxRetryCount) {
retryCount++;
return true; // Retry the test
}
return false; // Do not retry the test further
}
}
05
06
Optimizing Test Execution: Heuristic Algorithm for Self-Healing

More Related Content

PPTX
Building Resilient Software A Deep Dive into Self-Healing Test Automation Fra...
Knoldus Inc.
 
PPTX
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QAFest
 
PPTX
Exploratory testing using heuristics
Michelle Lagare, CSM
 
ODP
Good Practices On Test Automation
Gustavo Labbate Godoy
 
PDF
Intro to JavaScript Testing
Ran Mizrahi
 
PDF
Leveraging Self-Healing Techniques to Foster Sustainable Automation Scripts.pdf
pCloudy
 
PDF
Capstone-Project-Apply-Automation-Testing.pdf
PHCNGPHANMINH
 
PDF
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
 
Building Resilient Software A Deep Dive into Self-Healing Test Automation Fra...
Knoldus Inc.
 
QA Fest 2019. Анна Чернышова. Self-healing test automation 2.0. The Future
QAFest
 
Exploratory testing using heuristics
Michelle Lagare, CSM
 
Good Practices On Test Automation
Gustavo Labbate Godoy
 
Intro to JavaScript Testing
Ran Mizrahi
 
Leveraging Self-Healing Techniques to Foster Sustainable Automation Scripts.pdf
pCloudy
 
Capstone-Project-Apply-Automation-Testing.pdf
PHCNGPHANMINH
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
 

Similar to Optimizing Test Execution: Heuristic Algorithm for Self-Healing (20)

PPT
UNIT IV.ppt
Varshini62
 
PDF
Using Self-Healing to Reduce Automation Script Maintenance
pCloudy
 
PDF
Gabriel carabat a healthy approach for test automation
Romania Testing
 
PPTX
Test Automation - Presented by Nagarajan, Architect @ TechCafe-2014
Neev Technologies
 
PPT
Software test management
Vishad Garg
 
PPTX
Using evolutionary testing to improve efficiency and quality
Faysal Ahmed
 
PDF
Software Test Automation
Josh Case
 
PPTX
Test Automation Improvement by Machine Learning Jasst'21 Tokyo
Sadaaki Emura
 
PDF
IPA Fall Days 2019
Annibale Panichella
 
PPT
Agile testing
tanvir afzal
 
PDF
Modern Strategies for Automated Testing Success.pdf
RohitBhandari66
 
PPTX
Best Practices for Implementing Automated Functional Testing
Jason Roy
 
PPTX
iSTQB Chap 5 Managing the Test Activities
zubair khan shinwari
 
PDF
Agile Acceptance testing with Fitnesse
ClareMcLennan
 
PDF
Lessons Learned When Automating
Alan Richardson
 
PPTX
Lecture-11-AutomatedTesting-software.pptx
ssuser39f59e
 
PDF
Test automation methodologies
Mesut Günes
 
PDF
Navigating the World of Software Testing: An Expert’s Perspective
uncodemy
 
PDF
Scalable Software Testing and Verification of Non-Functional Properties throu...
Lionel Briand
 
PDF
Adaptive Automation: Tests that Recover Instead of Failing
TechWell
 
UNIT IV.ppt
Varshini62
 
Using Self-Healing to Reduce Automation Script Maintenance
pCloudy
 
Gabriel carabat a healthy approach for test automation
Romania Testing
 
Test Automation - Presented by Nagarajan, Architect @ TechCafe-2014
Neev Technologies
 
Software test management
Vishad Garg
 
Using evolutionary testing to improve efficiency and quality
Faysal Ahmed
 
Software Test Automation
Josh Case
 
Test Automation Improvement by Machine Learning Jasst'21 Tokyo
Sadaaki Emura
 
IPA Fall Days 2019
Annibale Panichella
 
Agile testing
tanvir afzal
 
Modern Strategies for Automated Testing Success.pdf
RohitBhandari66
 
Best Practices for Implementing Automated Functional Testing
Jason Roy
 
iSTQB Chap 5 Managing the Test Activities
zubair khan shinwari
 
Agile Acceptance testing with Fitnesse
ClareMcLennan
 
Lessons Learned When Automating
Alan Richardson
 
Lecture-11-AutomatedTesting-software.pptx
ssuser39f59e
 
Test automation methodologies
Mesut Günes
 
Navigating the World of Software Testing: An Expert’s Perspective
uncodemy
 
Scalable Software Testing and Verification of Non-Functional Properties throu...
Lionel Briand
 
Adaptive Automation: Tests that Recover Instead of Failing
TechWell
 
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
PPTX
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
PPTX
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
PPTX
Java 17 features and implementation.pptx
Knoldus Inc.
 
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
PPTX
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
PPTX
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
PPTX
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
PPTX
Intro to Azure Container App Presentation
Knoldus Inc.
 
PPTX
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
PPTX
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
PPTX
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
PPTX
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
PPTX
Facilitation Skills - When to Use and Why.pptx
Knoldus Inc.
 
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
Java 17 features and implementation.pptx
Knoldus Inc.
 
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
Intro to Azure Container App Presentation
Knoldus Inc.
 
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Facilitation Skills - When to Use and Why.pptx
Knoldus Inc.
 
Ad

Recently uploaded (20)

PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PPTX
C Programming Basics concept krnppt.pptx
Karan Prajapat
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PDF
Software Development Methodologies in 2025
KodekX
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
This slide provides an overview Technology
mineshkharadi333
 
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
Doc9.....................................
SofiaCollazos
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
C Programming Basics concept krnppt.pptx
Karan Prajapat
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Software Development Methodologies in 2025
KodekX
 

Optimizing Test Execution: Heuristic Algorithm for Self-Healing

  • 1. Optimizing Test Execution: Heuristic Algorithm for Self-Healing Nidhi Yadav (Automation Consultant) Test Automation Competency
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes  Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time!  Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter.  Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call.  Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. 1. Introduction  Challenges of Traditional Test Execution  Importance of Optimized Test Execution 2. Understanding Self-Healing  Overview  How Self-Healing works? 3. Heuristic Algorithm for Self-Healing § Defining Heuristics for Self-Healing § Best Practices 4. Types of Heuristic Algorithms Adaptive Locator Recovery Algorithm LCS based Algorithms Annotation Based Locator Algorithm Retry Mechanisms 5. Demo 6. Q/A
  • 5. Challenges of Traditional Test Execution Test execution is the process of running tests on software applications to ensure their functionality, performance, and reliability.  High Maintenance Efforts: Frequent application changes require constant updates to test scripts, diverting focus from critical activities.  Frequent Test Failures Due to Minor Changes: Minor application updates cause test scripts to fail, leading to false positives and complicating issue identification.  Time-Consuming Debugging Processes: Manual and complex issue identification delays feedback to developers and slows the release cycle.  Lack of Adaptability: Static test scripts miss bugs due to inability to adjust to dynamic application changes, compromising reliability
  • 6. Importance of Optimized Test Execution Enhanced Efficiency Optimized test execution ensures that test processes are streamlined, reducing the time and effort required to run tests. Better Test Coverage Comprehensive testing ensures that more aspects of the application are verified, reducing the risk of undetected bugs and improving software robustness helping QA teams to achieve broader and deeper test coverage. Improved Reliability By minimizing false positives and negatives, optimized test execution increases the accuracy of test results. Reliable tests ensure that real issues are identified and addressed promptly. Enhanced Adaptability allows test scripts to adapt quickly to changes in the application ensuring that testing remains relevant and effective even as the application evolves
  • 7. 02
  • 8. Overview  Self-Healing, the automation of test automation, recognizes changes in the “system under test” and automatically adapts the test execution during runtime so that the tests remain functional.  Whenever a test is executed, such algorithms conduct a thorough search of the application's UI for any pre-existing objects.  The results are then compared to the model of the application used in the automated tests.  If any modifications to the application are detected, there is a capability that allows tests to be modified automatically.
  • 10. 03
  • 11. Overview  Heuristics are methods that use shortcuts to find solutions quickly.  Known as Approximate Algorithms: approximate rather than precise, providing near-perfect solutions within a given timeframe.  Why Heuristics?
  • 12. Best Practices Carefully Design and Test Heuristic Clearly Define the Scope of Self-Healing Rollback Mechanisms Monitor and Refine Self-Healing Behavior Start Small and Scale Incrementally
  • 13. 04
  • 14. Adaptive Locator Recovery Algorithm  Sophisticated heuristic approach designed to enhance the reliability and robustness of automated testing. WebElement element = searchByVisibleText(driver, locatorKey); if (element != null) { System.out.println("Element found using visible text heuristic."); return element; } WebElement element = searchByNeighboringElements(driver, locatorKey); if (element != null) { System.out.println("Element found using neighboring elements heuristic."); return element; } WebElement element = searchByRegex(driver, locatorKey); if (element != null) { System.out.println("Element found using regex heuristic."); return element; }
  • 15. Adaptive Locator Recovery Algorithm USE CASES:
  • 16. Longest Common Subsequence (LCS) Algorithm  This algorithm, considers the weight of various attributes such as tag, id, class, value, and others.  It identifies the longest sub-sequence that is common to all sequences in a set of sequences.
  • 17. Longest Common Subsequence (LCS) Algorithm  Healenium is an open-source library for automated testing that leverages the power of machine learning (LCS algorithm) to improve the reliability and resilience of tests.  Improves stability of Selenium based tests.
  • 18. Annotation Based Locator Algorithm  The ABLA algorithm capable of testing a website and restoring locators in case they are broken.  When the node id, class or another attribute is changed, special attributes are used to tag nodes maintaining the previous values.  ABLA Algorithm: 1: for locatorList do 2: attribute = getLocatorAttribute(locatorList, i, 0) 3: value = getLocatorValue(locatorList, i, 1) 4: node = executeLocator(attribute, value) 5: if node != null then 6: executeTest(node) 7: else 8: newNode = findNewNode(attribute, value) 9: if newNode != null then 10: newNodeAttr = getNewNodeAttr(newNode) 11: newNodeValue = getNewNodeValue(newNode) 12: restoreLocator(locatorList, attribute, newNodeValue, i) 13: executeTest(newNode) 1: param1: attribute 2: param2: value 3: if attribute == ”id” then 4: node = findNode(”prevId”, value) 5: else if attribute == ”class” then 6: node = findNode(”prevClass”, value) 7: else 8: node = findNode(”preva”+attribute, value) 9: if node == null then 10: node = findNode(attribute, ”prevv”+value) 11: return node findNewNode function:
  • 19. Annotation Based Locator Algorithm  USE CASES:
  • 20. Retry Mechanisms  Such mechanism automatically retries a failing action a limited number of times using interfaces like IRetryAnalyzer .  Helpful for intermittent failures caused by network issues or temporary glitches.  Using the retryAnalyzer attribute in the @Test annotation @Test(retryAnalyzer = Retry.class) public void testLogin() { } package retryMechanism; import org.testng.IRetryAnalyzer; import org.testng.ITestResult; public class Retry implements IRetryAnalyzer { private int maxRetryCount = 2; // Define the maximum number of retry attempts private int retryCount = 0; @Override public boolean retry(ITestResult result) { if (retryCount < maxRetryCount) { retryCount++; return true; // Retry the test } return false; // Do not retry the test further } }
  • 21. 05
  • 22. 06