SlideShare a Scribd company logo
1 of 33
Download to read offline
Towards the Generation of Robust E2E
Test Cases
in Template-based Web Applications
Porfirio Tramontana, Anna Rita Fasolino
University of Naples “Federico II”
48th Euromicro Conference Series on Software Engineering
and Advanced Applications (SEAA)
Maspalomas, Gran Canaria, Spain, September 1st, 2022.
SEAA 2022, Maspalomas, September 1st, 2022
Motivations
◼ Capture and Replay Testing of Web
applications
➢ Effective and efficient solution for E2E testing
➢ Support in test scripting generation
➢ Automation of test case execution
➢ Requires limited programming and testing
skills
 Test case fragility
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Test case fragility: examples
◼ We want to register the click on the Mark as Done button
◼ Possible locator suggested by Selenium:
◼ xpath = .btn-success
 Fragile!
◼ May broke for style sheet changing
◼ May be ambiguous for buttons having the same style
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Test case fragility: examples
◼ We want to register the click on the Mark as Done button
◼ Possible locator suggested by Selenium:
◼ xpath = (//button[@type='button'])[4]
 Fragile!
◼ May broke with button position changes
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Test case fragility: examples
◼ We want to register the click on the Mark as Done button
◼ Possible locator suggested by Selenium:
◼ xpath = //button[3]
 Fragile!
◼ May broke with button position changes
◼ May broke for table redesign
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Test case fragility: examples
◼ We want to register the click on the Mark as Done button
◼ Possible locator suggested by Selenium:
◼ xpath = //button[contains(.,'✔ Mark as Done')]
 Fragile!
◼ May broke for localization/changing in text
◼ May broke for button type changing
◼ May broke for character code changing
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Test case fragility: examples
◼ We want to register the click on the Mark as Done button
◼ Possible locator suggested by Katalon Recorder:
◼ xpath=(.//*[normalize-space(text()) and normalize-space(.)='✘
Remove'])[1]/following::button[1]
 Fragile!
◼ May broke for localization/changing in text
◼ May broke for button type changing
◼ May broke for character code changing
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Possible solutions in literature 1/3
◼ Generation of robust locators
◼ Heuristic rules are used to provide a ranking
between a set of possible locators, based on
different possible features (text, relative
position of tags, …)
◼ M. Leotta et al., 2014. Reducing web test cases
◼ M. Leotta et al., 2016. Robula+: An algorithm for generating robust XPath locators for
web testing.
 Problem: Heuristic locators are fragile with
respect to some specific maintenance
interventions
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Possible solutions in literature 2/3
◼ Automatic repairing of broken locators
◼ By maintaining different valid locators and
dynamically repairing broken test cases by using
alternative locators
◼ M. Leotta et al. 2015. Using Multi-Locators to Increase the Robustness of Web Test Cases
◼ I. Aldalur et al., 2020. ABLA: An Algorithm for Repairing Structure-Based Locators Through
Attribute Annotations.
 Problem:
◼ These solutions need a support to maintain
alternative locators / substitute them to broken
ones
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Possible solutions in literature 3/3
◼ Preventive improvement of Web
application testability
◼ The developer may add identifiers while
implementing web pages in order to assure
their reliable identification
◼ Bajaj et al. 2015. Synthesizing Web Element Locators
◼ Bajaj et al. 2016. LED: Tool for synthesizing web element locators
 Problems:
◼ Not applicable on existing web sites
◼ Duplication of identifiers on dynamically
generated client pages
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Proposed Solution : context
◼ MVVM Web applications
◼ Angular / Smarty / Freemarker / Twig
◼ Separation of UI design and logic with HTML
templates
◼ Template source code available at development time
◼ Dynamic generation of tags on the client side
◼ E.g. with ng- attributes (Angular)
◼ Use of C&R tools supporting design of new
locator generators
◼ E.g. Katalon Recorder
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Our approach
1. Automatic injection of hooks in the
source code of web templates and html
pages
2. Automatic generation of locators based
on injected hooks
◼ Integrated with C&R tools (e.g. Katalon
Recorder)
3. Continuous integration life cycle
◼ Supported by Github
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
<ui - view >
...
<table >
...
<tbody >
<tr ng - repeat =" task _in_ ctrl . tasks ">
...
<td >
<div class ="form - group ">
<button type =" button " ng -if="!! task . done " ng - click =" task . done _=_ false ">
&# x270E ; Mark as To Do </ button >
<button type =" button " ng -if="! task . done " ng - click =" task . done _=_true ">&#
x2714 ; Mark as Done </ button >
<button type =" button " ng -if="! task . done " ui - sref =". edit ({ taskIndex :_
$index })">&# x270E ; Edit </ button >
<button type =" button ">&# x2718 ; Remove </ button >
</ div >
</td > </tr > </ tbody > </ table >
</ui - view >
Example Source code : Angular
<html >
...
<body ng - app =" myApp ">
<div class =" container ">
<ui - view ></ui - view >
</ div >
...
</ body >
</ html >
index.html
template.html
Item to be located
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Example 1/3
◼ A robust locator must identify the involved tag
1. We inject an identifier (hook) in the tag code
◼ <button type =" button " ng -if="! task . done " ng - click =" task . done _=_ true " x-
test -hook -81 >&# x2714 ; Mark as Done </ button >
2. Since the tag is defined in the context of a template,
we have to inject another identifier on the template
definition
◼ <ui - view x-test -tpl -62 >
3. A template instance may be inserted multiple times
in a page: we have to inject another identifier into
the tag including the template
◼ <ui - view x-test -hook -9 ></ui - view >
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Example 2/3
4. The tag to be located is included in a table row. Angular may
generate different rows. Our item may be identified by means
of the tr tag and the index of the selected item. We have to
inject an identifier on the table row tag
◼ <tr ng - repeat =" task _in_ ctrl . tasks " x-test -hook -73 >
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Example 3/3
◼ A locator that include all these information is the
following:
◼ //*[ @x-test-tpl-1]//*[ @x-test-hook-9]
//*[ @x-test-tpl-62]//*[ @x-test-hook-73][2]
//*[ @x-test-hook-81]
◼ x-test-tpl-1 identifies the body of the index.html page
◼ x-test-hook-9 identifies the tag including the template
◼ x-test-tpl-62 identifies the definition of the template (that
includes the table)
◼ x-test-hook-73[2] identifies the second row of the table including
the button
◼ x-test-hook-81 identifies the button into the table row
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
<ui-view x-test-tpl-62>
...
<table x-test-hook-65>
...
<tbody x-test-hook-72>
<tr ng-repeat="task in ctrl.tasks" x-test-hook-73>
...
<td x-test-hook-79>
<div class="form-group" x-test-hook-80>
<button type="button" ng-if="!!task.done" ng-click="task.done = false" xtest-
hook-82>&#x270E; Mark as To Do</button>
<button type="button" ng-if="!task.done" ng-click="task.done = true" xtest-
hook-81>&#x2714; Mark as Done</button>
<button type="button" ng-if="!task.done" ui-sref=".edit({taskIndex: $index
})" x-test-hook-83>&#x270E; Edit</button>
<button type="button" x-test-hook-84>&#x2718; Remove</button>
</div>
</td> </tr> </tbody> </table>
</ui-view>
Hook Injected source code
<html x-test-tpl-1>
...
<body ng-app="myApp" x-
test-hook-7>
<div class="container" x-test-
hook-8>
<ui-view x-test-hook-9></ui-
view>
</div>
...
</body>
</html>
index.html
template.html
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Hook Injection Algorithm
◼ For each web page or template
◼ For each template definition
◼ If the template has not yet a hook
◼ Insert x-test-tpl-(number) hook attribute
◼ For each html tag
◼ If the tag has not a yet hook
◼ Insert x-test-hook-(number) hook attribute
◼ The algorithm automatically insert hooks with increasing (number)
in order to avoid the presence of items with the same hook
◼ The algorithm is idempotent and can be run incrementally
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Hook-based Locator Generation
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Hook-based Locator Generation
◼ The xpath locator will include hooks from:
1. Body of the html page
2. Tags including templates
3. Template definition tags
4. Tag of the element to be located
5. In addition, if any of these tags has siblings, the
index of the tag has to be included together with the
hook of the container tag
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Testing Process Integration
◼ The proposed solution can be integrated
in a E2E testing process supporting
regression testing
◼ Hook injection can be automatically executed
after each project release
◼ Test case registration with C&R tools may
generate hook-based locators
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Testing Process Integration
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Technical specs
◼ Hook injector has been implemented in node.js and
supports template languages having grammars defined
with TextMate (Angular, Smarty, Freemarker, Twig)
◼ Hook-based locator generation is implemented as a
script included in Katalon Recorder
◼ Katalon Recorder is able to generate executable test
cases
◼ For each test case, a headless executable version can be
automatically generated
◼ Test case execution and reporting is executed in the
context of Github by exploting Github Actions
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Validation Experiment
◼ RQ1 : How do the breakages in test cases
exploiting Hook-Based locators compare
with breakages in Non-Hook-Based test
cases?
◼ RQ2 : How does the use of Hook-based
locators influence the fragility of test cases
with respect to the use of Non- Hook-
based locators?
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Experimental setup
◼ Three teams of students of Advanced
Software Engineering (Laurea Degree in
Computer Engineering)
◼ They realized an Angular Web application
each, by following the proposed testing
process integration and by considering
two possible locators:
◼ Default locators provided by Katalon
◼ Hook-based locators
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Experiment execution
◼ After each application release, regression testing
is executed.
◼ Some test cases broken due to locators (TKO):
◼ By obsolescence
◼ when the test scenario has been eliminated
◼ E.g. the functionality has been removed and the command
button has been deleted
◼ By fragility (TKOFRA)
◼ When modifications (in page layouts) cause the brekage of a
test case that is still needed
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Results
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Summary results
◼ On a total set of 214 regression test cases
◼ 16 test cases fail by obsolescence
◼ 30 test cases fail by fragility of the Default
Katalon Recorder locators
◼ No test cases fail by fragility of the Hook-
based Locators
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Answers
◼ RQ1: The adoption of Hook-based locators,
instead of Default Katalon ones, significantly
reduces the percentage of broken tests in all
the considered applications, with a reduction
up to 82%.
◼ RQ2: The adoption of Hook-based locators,
instead of Default Katalon ones, drastically
reduces the fragility of test cases in all the
applications, with a reduction of 100%.
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Typologies of locator breakages
◼ Attributes disappearing
◼ Text Modifications
◼ Tag type changes
◼ Index value changes
◼ except for cases involving siblings tags
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Conclusions
◼ We have proposed a novel technique
supporting the generation of robust
locators for E2E testing of template based
Web applications
◼ It can be implemented in continuous
integration lifecycles
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Future Works
◼ The implemented software is open source
◼ The direct link is into the paper
◼ https://sites.google.com/view/porfiriotramontana/home-page
◼ It is a prototype: we are currently experimenting its
integration in a Github supported lifecycle
◼ The validation experiment provided encouraging
results about the robustness of the generated
locators
◼ Collaborations are welcome for future
experiments and for the improvement of the
Github Actions support
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
Thank you for your attention!
SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022

More Related Content

Similar to Generate Robust E2E Test Cases for Template-based Web Apps

cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IPD. j Vicky
 
Final year project working documentation 2020
Final year project working documentation 2020Final year project working documentation 2020
Final year project working documentation 2020Vikram Singh
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
Simo's Top 30 GTM tips
Simo's Top 30 GTM tipsSimo's Top 30 GTM tips
Simo's Top 30 GTM tipsSimo Ahava
 
A technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsA technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsPorfirio Tramontana
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Gáspár Nagy
 
Webinar: ArangoDB 3.8 Preview - Analytics at Scale
Webinar: ArangoDB 3.8 Preview - Analytics at Scale Webinar: ArangoDB 3.8 Preview - Analytics at Scale
Webinar: ArangoDB 3.8 Preview - Analytics at Scale ArangoDB Database
 
Demystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using WatirDemystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using WatirHirday Lamba
 
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9Nuno Godinho
 
Engaging Tech Students Past Traditional Hands On
Engaging Tech Students Past Traditional Hands OnEngaging Tech Students Past Traditional Hands On
Engaging Tech Students Past Traditional Hands OnFiras Obeid
 
Scaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabScaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabRoman
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)WebStackAcademy
 
Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?Itai Yaffe
 
Large scale data capture and experimentation platform at Grab
Large scale data capture and experimentation platform at GrabLarge scale data capture and experimentation platform at Grab
Large scale data capture and experimentation platform at GrabRoman
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project D. j Vicky
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project D. j Vicky
 

Similar to Generate Robust E2E Test Cases for Template-based Web Apps (20)

cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 
Final year project working documentation 2020
Final year project working documentation 2020Final year project working documentation 2020
Final year project working documentation 2020
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Simo's Top 30 GTM tips
Simo's Top 30 GTM tipsSimo's Top 30 GTM tips
Simo's Top 30 GTM tips
 
A technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsA technique for parallel gui testing of android applications
A technique for parallel gui testing of android applications
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
 
Webinar: ArangoDB 3.8 Preview - Analytics at Scale
Webinar: ArangoDB 3.8 Preview - Analytics at Scale Webinar: ArangoDB 3.8 Preview - Analytics at Scale
Webinar: ArangoDB 3.8 Preview - Analytics at Scale
 
PagesToGo.pdf
PagesToGo.pdfPagesToGo.pdf
PagesToGo.pdf
 
Demystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using WatirDemystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using Watir
 
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
 
Satchmo
SatchmoSatchmo
Satchmo
 
Engaging Tech Students Past Traditional Hands On
Engaging Tech Students Past Traditional Hands OnEngaging Tech Students Past Traditional Hands On
Engaging Tech Students Past Traditional Hands On
 
Scaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabScaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at Grab
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
 
Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?
 
Large scale data capture and experimentation platform at Grab
Large scale data capture and experimentation platform at GrabLarge scale data capture and experimentation platform at Grab
Large scale data capture and experimentation platform at Grab
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 

More from Porfirio Tramontana

An Approach for Model Based Testing of Augmented Reality Applications.pdf
An Approach for Model Based Testing of Augmented Reality Applications.pdfAn Approach for Model Based Testing of Augmented Reality Applications.pdf
An Approach for Model Based Testing of Augmented Reality Applications.pdfPorfirio Tramontana
 
Techniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing AutomationTechniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing AutomationPorfirio Tramontana
 
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...Porfirio Tramontana
 
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...Porfirio Tramontana
 
Web Application Testing in Fifteen Years of WSE
Web Application Testing in Fifteen Years of WSEWeb Application Testing in Fifteen Years of WSE
Web Application Testing in Fifteen Years of WSEPorfirio Tramontana
 
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...Porfirio Tramontana
 
Comprehending Web Applications by a Clustering Based Approach
Comprehending Web Applications by a Clustering Based Approach Comprehending Web Applications by a Clustering Based Approach
Comprehending Web Applications by a Clustering Based Approach Porfirio Tramontana
 
Reverse Engineering Web Applications
Reverse Engineering Web ApplicationsReverse Engineering Web Applications
Reverse Engineering Web ApplicationsPorfirio Tramontana
 
Recovering Interaction Design Patterns in Web Applications
Recovering Interaction Design Patterns in Web Applications Recovering Interaction Design Patterns in Web Applications
Recovering Interaction Design Patterns in Web Applications Porfirio Tramontana
 
Improving Usability of Web Pages for Blind
Improving Usability of Web Pages for BlindImproving Usability of Web Pages for Blind
Improving Usability of Web Pages for BlindPorfirio Tramontana
 
Techniques and Tools for Rich Internet Applications Testing
Techniques and Tools for Rich Internet Applications TestingTechniques and Tools for Rich Internet Applications Testing
Techniques and Tools for Rich Internet Applications TestingPorfirio Tramontana
 
Comprehending Ajax Web Applications by the DynaRIA Tool
Comprehending Ajax Web Applications by the DynaRIA ToolComprehending Ajax Web Applications by the DynaRIA Tool
Comprehending Ajax Web Applications by the DynaRIA ToolPorfirio Tramontana
 
A GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application TestingA GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application TestingPorfirio Tramontana
 
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...Porfirio Tramontana
 
Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications Porfirio Tramontana
 
Using GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android AppsUsing GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android AppsPorfirio Tramontana
 
A Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android ApplicationsA Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android ApplicationsPorfirio Tramontana
 
DynaRIA: a Tool for Ajax Web Application Comprehension
DynaRIA: a Tool for Ajax Web Application ComprehensionDynaRIA: a Tool for Ajax Web Application Comprehension
DynaRIA: a Tool for Ajax Web Application ComprehensionPorfirio Tramontana
 
Rich Internet Application Testing Using Execution Trace Data
Rich Internet Application Testing  Using Execution Trace Data Rich Internet Application Testing  Using Execution Trace Data
Rich Internet Application Testing Using Execution Trace Data Porfirio Tramontana
 
An AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security EvaluationAn AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security EvaluationPorfirio Tramontana
 

More from Porfirio Tramontana (20)

An Approach for Model Based Testing of Augmented Reality Applications.pdf
An Approach for Model Based Testing of Augmented Reality Applications.pdfAn Approach for Model Based Testing of Augmented Reality Applications.pdf
An Approach for Model Based Testing of Augmented Reality Applications.pdf
 
Techniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing AutomationTechniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing Automation
 
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
 
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
 
Web Application Testing in Fifteen Years of WSE
Web Application Testing in Fifteen Years of WSEWeb Application Testing in Fifteen Years of WSE
Web Application Testing in Fifteen Years of WSE
 
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
 
Comprehending Web Applications by a Clustering Based Approach
Comprehending Web Applications by a Clustering Based Approach Comprehending Web Applications by a Clustering Based Approach
Comprehending Web Applications by a Clustering Based Approach
 
Reverse Engineering Web Applications
Reverse Engineering Web ApplicationsReverse Engineering Web Applications
Reverse Engineering Web Applications
 
Recovering Interaction Design Patterns in Web Applications
Recovering Interaction Design Patterns in Web Applications Recovering Interaction Design Patterns in Web Applications
Recovering Interaction Design Patterns in Web Applications
 
Improving Usability of Web Pages for Blind
Improving Usability of Web Pages for BlindImproving Usability of Web Pages for Blind
Improving Usability of Web Pages for Blind
 
Techniques and Tools for Rich Internet Applications Testing
Techniques and Tools for Rich Internet Applications TestingTechniques and Tools for Rich Internet Applications Testing
Techniques and Tools for Rich Internet Applications Testing
 
Comprehending Ajax Web Applications by the DynaRIA Tool
Comprehending Ajax Web Applications by the DynaRIA ToolComprehending Ajax Web Applications by the DynaRIA Tool
Comprehending Ajax Web Applications by the DynaRIA Tool
 
A GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application TestingA GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application Testing
 
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
 
Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications
 
Using GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android AppsUsing GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android Apps
 
A Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android ApplicationsA Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android Applications
 
DynaRIA: a Tool for Ajax Web Application Comprehension
DynaRIA: a Tool for Ajax Web Application ComprehensionDynaRIA: a Tool for Ajax Web Application Comprehension
DynaRIA: a Tool for Ajax Web Application Comprehension
 
Rich Internet Application Testing Using Execution Trace Data
Rich Internet Application Testing  Using Execution Trace Data Rich Internet Application Testing  Using Execution Trace Data
Rich Internet Application Testing Using Execution Trace Data
 
An AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security EvaluationAn AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security Evaluation
 

Recently uploaded

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 

Generate Robust E2E Test Cases for Template-based Web Apps

  • 1. Towards the Generation of Robust E2E Test Cases in Template-based Web Applications Porfirio Tramontana, Anna Rita Fasolino University of Naples “Federico II” 48th Euromicro Conference Series on Software Engineering and Advanced Applications (SEAA) Maspalomas, Gran Canaria, Spain, September 1st, 2022. SEAA 2022, Maspalomas, September 1st, 2022
  • 2. Motivations ◼ Capture and Replay Testing of Web applications ➢ Effective and efficient solution for E2E testing ➢ Support in test scripting generation ➢ Automation of test case execution ➢ Requires limited programming and testing skills  Test case fragility SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 3. Test case fragility: examples ◼ We want to register the click on the Mark as Done button ◼ Possible locator suggested by Selenium: ◼ xpath = .btn-success  Fragile! ◼ May broke for style sheet changing ◼ May be ambiguous for buttons having the same style SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 4. Test case fragility: examples ◼ We want to register the click on the Mark as Done button ◼ Possible locator suggested by Selenium: ◼ xpath = (//button[@type='button'])[4]  Fragile! ◼ May broke with button position changes SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 5. Test case fragility: examples ◼ We want to register the click on the Mark as Done button ◼ Possible locator suggested by Selenium: ◼ xpath = //button[3]  Fragile! ◼ May broke with button position changes ◼ May broke for table redesign SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 6. Test case fragility: examples ◼ We want to register the click on the Mark as Done button ◼ Possible locator suggested by Selenium: ◼ xpath = //button[contains(.,'✔ Mark as Done')]  Fragile! ◼ May broke for localization/changing in text ◼ May broke for button type changing ◼ May broke for character code changing SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 7. Test case fragility: examples ◼ We want to register the click on the Mark as Done button ◼ Possible locator suggested by Katalon Recorder: ◼ xpath=(.//*[normalize-space(text()) and normalize-space(.)='✘ Remove'])[1]/following::button[1]  Fragile! ◼ May broke for localization/changing in text ◼ May broke for button type changing ◼ May broke for character code changing SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 8. Possible solutions in literature 1/3 ◼ Generation of robust locators ◼ Heuristic rules are used to provide a ranking between a set of possible locators, based on different possible features (text, relative position of tags, …) ◼ M. Leotta et al., 2014. Reducing web test cases ◼ M. Leotta et al., 2016. Robula+: An algorithm for generating robust XPath locators for web testing.  Problem: Heuristic locators are fragile with respect to some specific maintenance interventions SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 9. Possible solutions in literature 2/3 ◼ Automatic repairing of broken locators ◼ By maintaining different valid locators and dynamically repairing broken test cases by using alternative locators ◼ M. Leotta et al. 2015. Using Multi-Locators to Increase the Robustness of Web Test Cases ◼ I. Aldalur et al., 2020. ABLA: An Algorithm for Repairing Structure-Based Locators Through Attribute Annotations.  Problem: ◼ These solutions need a support to maintain alternative locators / substitute them to broken ones SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 10. Possible solutions in literature 3/3 ◼ Preventive improvement of Web application testability ◼ The developer may add identifiers while implementing web pages in order to assure their reliable identification ◼ Bajaj et al. 2015. Synthesizing Web Element Locators ◼ Bajaj et al. 2016. LED: Tool for synthesizing web element locators  Problems: ◼ Not applicable on existing web sites ◼ Duplication of identifiers on dynamically generated client pages SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 11. Proposed Solution : context ◼ MVVM Web applications ◼ Angular / Smarty / Freemarker / Twig ◼ Separation of UI design and logic with HTML templates ◼ Template source code available at development time ◼ Dynamic generation of tags on the client side ◼ E.g. with ng- attributes (Angular) ◼ Use of C&R tools supporting design of new locator generators ◼ E.g. Katalon Recorder SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 12. Our approach 1. Automatic injection of hooks in the source code of web templates and html pages 2. Automatic generation of locators based on injected hooks ◼ Integrated with C&R tools (e.g. Katalon Recorder) 3. Continuous integration life cycle ◼ Supported by Github SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 13. <ui - view > ... <table > ... <tbody > <tr ng - repeat =" task _in_ ctrl . tasks "> ... <td > <div class ="form - group "> <button type =" button " ng -if="!! task . done " ng - click =" task . done _=_ false "> &# x270E ; Mark as To Do </ button > <button type =" button " ng -if="! task . done " ng - click =" task . done _=_true ">&# x2714 ; Mark as Done </ button > <button type =" button " ng -if="! task . done " ui - sref =". edit ({ taskIndex :_ $index })">&# x270E ; Edit </ button > <button type =" button ">&# x2718 ; Remove </ button > </ div > </td > </tr > </ tbody > </ table > </ui - view > Example Source code : Angular <html > ... <body ng - app =" myApp "> <div class =" container "> <ui - view ></ui - view > </ div > ... </ body > </ html > index.html template.html Item to be located SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 14. Example 1/3 ◼ A robust locator must identify the involved tag 1. We inject an identifier (hook) in the tag code ◼ <button type =" button " ng -if="! task . done " ng - click =" task . done _=_ true " x- test -hook -81 >&# x2714 ; Mark as Done </ button > 2. Since the tag is defined in the context of a template, we have to inject another identifier on the template definition ◼ <ui - view x-test -tpl -62 > 3. A template instance may be inserted multiple times in a page: we have to inject another identifier into the tag including the template ◼ <ui - view x-test -hook -9 ></ui - view > SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 15. Example 2/3 4. The tag to be located is included in a table row. Angular may generate different rows. Our item may be identified by means of the tr tag and the index of the selected item. We have to inject an identifier on the table row tag ◼ <tr ng - repeat =" task _in_ ctrl . tasks " x-test -hook -73 > SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 16. Example 3/3 ◼ A locator that include all these information is the following: ◼ //*[ @x-test-tpl-1]//*[ @x-test-hook-9] //*[ @x-test-tpl-62]//*[ @x-test-hook-73][2] //*[ @x-test-hook-81] ◼ x-test-tpl-1 identifies the body of the index.html page ◼ x-test-hook-9 identifies the tag including the template ◼ x-test-tpl-62 identifies the definition of the template (that includes the table) ◼ x-test-hook-73[2] identifies the second row of the table including the button ◼ x-test-hook-81 identifies the button into the table row SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 17. <ui-view x-test-tpl-62> ... <table x-test-hook-65> ... <tbody x-test-hook-72> <tr ng-repeat="task in ctrl.tasks" x-test-hook-73> ... <td x-test-hook-79> <div class="form-group" x-test-hook-80> <button type="button" ng-if="!!task.done" ng-click="task.done = false" xtest- hook-82>&#x270E; Mark as To Do</button> <button type="button" ng-if="!task.done" ng-click="task.done = true" xtest- hook-81>&#x2714; Mark as Done</button> <button type="button" ng-if="!task.done" ui-sref=".edit({taskIndex: $index })" x-test-hook-83>&#x270E; Edit</button> <button type="button" x-test-hook-84>&#x2718; Remove</button> </div> </td> </tr> </tbody> </table> </ui-view> Hook Injected source code <html x-test-tpl-1> ... <body ng-app="myApp" x- test-hook-7> <div class="container" x-test- hook-8> <ui-view x-test-hook-9></ui- view> </div> ... </body> </html> index.html template.html SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 18. Hook Injection Algorithm ◼ For each web page or template ◼ For each template definition ◼ If the template has not yet a hook ◼ Insert x-test-tpl-(number) hook attribute ◼ For each html tag ◼ If the tag has not a yet hook ◼ Insert x-test-hook-(number) hook attribute ◼ The algorithm automatically insert hooks with increasing (number) in order to avoid the presence of items with the same hook ◼ The algorithm is idempotent and can be run incrementally SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 19. Hook-based Locator Generation SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 20. Hook-based Locator Generation ◼ The xpath locator will include hooks from: 1. Body of the html page 2. Tags including templates 3. Template definition tags 4. Tag of the element to be located 5. In addition, if any of these tags has siblings, the index of the tag has to be included together with the hook of the container tag SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 21. Testing Process Integration ◼ The proposed solution can be integrated in a E2E testing process supporting regression testing ◼ Hook injection can be automatically executed after each project release ◼ Test case registration with C&R tools may generate hook-based locators SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 22. Testing Process Integration SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 23. Technical specs ◼ Hook injector has been implemented in node.js and supports template languages having grammars defined with TextMate (Angular, Smarty, Freemarker, Twig) ◼ Hook-based locator generation is implemented as a script included in Katalon Recorder ◼ Katalon Recorder is able to generate executable test cases ◼ For each test case, a headless executable version can be automatically generated ◼ Test case execution and reporting is executed in the context of Github by exploting Github Actions SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 24. Validation Experiment ◼ RQ1 : How do the breakages in test cases exploiting Hook-Based locators compare with breakages in Non-Hook-Based test cases? ◼ RQ2 : How does the use of Hook-based locators influence the fragility of test cases with respect to the use of Non- Hook- based locators? SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 25. Experimental setup ◼ Three teams of students of Advanced Software Engineering (Laurea Degree in Computer Engineering) ◼ They realized an Angular Web application each, by following the proposed testing process integration and by considering two possible locators: ◼ Default locators provided by Katalon ◼ Hook-based locators SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 26. Experiment execution ◼ After each application release, regression testing is executed. ◼ Some test cases broken due to locators (TKO): ◼ By obsolescence ◼ when the test scenario has been eliminated ◼ E.g. the functionality has been removed and the command button has been deleted ◼ By fragility (TKOFRA) ◼ When modifications (in page layouts) cause the brekage of a test case that is still needed SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 27. Results SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 28. Summary results ◼ On a total set of 214 regression test cases ◼ 16 test cases fail by obsolescence ◼ 30 test cases fail by fragility of the Default Katalon Recorder locators ◼ No test cases fail by fragility of the Hook- based Locators SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 29. Answers ◼ RQ1: The adoption of Hook-based locators, instead of Default Katalon ones, significantly reduces the percentage of broken tests in all the considered applications, with a reduction up to 82%. ◼ RQ2: The adoption of Hook-based locators, instead of Default Katalon ones, drastically reduces the fragility of test cases in all the applications, with a reduction of 100%. SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 30. Typologies of locator breakages ◼ Attributes disappearing ◼ Text Modifications ◼ Tag type changes ◼ Index value changes ◼ except for cases involving siblings tags SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 31. Conclusions ◼ We have proposed a novel technique supporting the generation of robust locators for E2E testing of template based Web applications ◼ It can be implemented in continuous integration lifecycles SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 32. Future Works ◼ The implemented software is open source ◼ The direct link is into the paper ◼ https://sites.google.com/view/porfiriotramontana/home-page ◼ It is a prototype: we are currently experimenting its integration in a Github supported lifecycle ◼ The validation experiment provided encouraging results about the robustness of the generated locators ◼ Collaborations are welcome for future experiments and for the improvement of the Github Actions support SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022
  • 33. Thank you for your attention! SEAA 2022, Maspalomas, Gran Canaria, September 1st, 2022