mabl’s Adaptive Testing with Angular and React Apps

mabl ’ s Adaptive Testing with Angular and React Apps Chou Yang March 21, 2018 Chou is a solution engineer move merchandise marketer who loves to connect with everyone 's int

February 15, 2026 · 5 min read · Testing Guide

mabl ’ s Adaptive Testing with Angular and React Apps

Chou Yang
March 21, 2018
Chou is a solution engineer move merchandise marketer who loves to connect with everyone 's internal tiddler to read their purest wants and needs, always leaving a glint of sparkle in her wake. Like a fairy godmother.

Test automation & nbsp; can automatize some insistent, but necessary chore. But if you 're not careful, you can quickly descend into the rabbit hole of track failing tests and lose sight of the equally necessary exploratory questions: & nbsp;“ Can our exploiter well complete the exploiter journey? ” “ Are there likely glitch with this journey? ” “ Is the quality of this journeying regressing? ”

Tests are brittle because the underlying mechanism of XPaths, CSS selectors, element IDs, and other form are often tightly coupled with automated exam. This is particularly painful when you have apps with dynamical locators or locators that aren ’ t necessarily unequalled, such as can be the case with Angular and React apps.

A machine-learning-driven testing solvent like mabl handle apps with dynamic UIs to help testers focus on the human side of examination, which makes the testing office so unique and powerful in the first spot.

“ I educate a few journeys in my Angular app that postulate unequaled values for every execution and was surprised to see that mabl supported this and delighted that my tests completed successfully. ”

- Cathy, Lead Test Engineer at Immuta

How does mabl do this? It ’ s all make into her trial version ability.

What info does mabl use to enable full-bodied, adaptive tests?

As quizzer interact with the to make a test, under the screening, mabl captures your user journeys using our own proprietary domain-specific language. She also gathers a outstanding deal of DOM factor attributes, holding, and visual item (like XPaths, tag names, class attributes, schoolbook, and various contextual identifiers) to facilitate identify conceptually equivalent elements in next test run of the journeying.

So now that she has an understanding of the user journeying, as well as all this extra information, mabl knows enough about each activeness in the journey to identify the appropriate element again, or find likely replacements for it as the UI changes. & nbsp;When there ’ s exclusively one probable candidate available, mabl will incrementally update her models for the comparable stride of the journey, so tests will stay up to date even after several successive UI alteration.

Much of this information can even be applied to the same journey in other environments, so prove running through the same app will run systematically. As mabl gathers more information about replacement candidates across many apps, this will ultimately be apply in more advanced models to prioritise future candidates across journeys and even across apps.

But the question is reckonrobustmodification; can mabl even adapt? What does mabl do when there ’ s no obvious rightfield answer?

mabl uses the collected information to be data-based. Based on past identifications of elements, she can rank fond and uncertain matches. & nbsp;To control if the observational action was correct, mabl assess how the residual of the journey unfolds.

For model, she considers whether assertion pass, whether she can complete subsequent actions, and the optical appearance of the leave app state compared to previous trial. If mabl determines that her fix for the exam was successful,she ’ ll let you know what the proposed fix was. From here, you can simply disapprove mabl ’ s fix for the journey if it was wrong, and mabl will think that for future runs. & nbsp;

Use mabl for free

Enough talk, & nbsp; let ’ s see an representative of this in Angular!

As mentioned at the oncoming, one of the trouble with plow a miscellanea of modern web frameworks like Angular and React is that they rely heavily on DOM manipulation and JavaScript execution. In exceptional, the DOM elements generated by these model often include minimal and opaque attributes, making them hard to distinguish.

However, humansmust be able to recognize how to guide a especial action across loop of the UI; mabl gathers some of the like contextual clues. & nbsp;Although element attributes may be deficient to identify a peculiar constituent for interaction during a journey, there are a smorgasbord of other active or computed place to be used, like inner text and rendered fix or sizing.

Consider a uncomplicated example of a dynamically generated inclination in an Angular app withngFor(similarly withng-repeatin AngularJS 1.x or an array of generated list elements in React):

 

 

SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.

 

 

 

 

 

 

 

 

 

 

 

 

 

In this example, we have a screen that shows a list of user roles in a hypothetic app where each role can be clicked to get a detailed description of the role. This gets instantiate as a series of list (& lt;li& gt;) ingredient, each containing an anchorman (& lt;a& gt;) factor with the clicks handled by Angular -- the href attribute of each anchor is the like, self-referential, “ # ” value even though a click results in displaying a different role description for each through DOM manipulation by Angular JavaScript code. Just study the element attributes, each ingredient looks indistinguishable (e.g., & lt;a _ngcontent-c5 href= ” # ”& gt; or merely & lt;a href= ” # ”& gt; in React), but the inner text of each differs.

We can develop mabl to click on the roles in a specific order. On the bottom right is the & nbsp; recording each step as we interact with our Angular app:

Below you 'll find the tryout yield from the mabl app. You can see her collecting information at each step of the journey, then dispatch the test successfully (accompany screenshots that mabl collects of the app at each step are shown on the right):

So when our supposititious app adds an “ A.3 ” role in the list ahead of “ B.0 ”, mabl is still able to identify the “ Role B.0 ” anchor element by using the internal text holding of the anchor constituent, and update what she knows about that factor.


If the name of the roles be later alter (e.g., “ B.0 ” becomes “ Beta-Zero ”), mabl would cognise that the correct element was last seen in the 4th position of the leaning (both by visual location and by concluding known XPath). So she would rank the “ Beta-Zero ” link as the well-nigh likely candidate and evaluate the rest of the journey to determine that she had create a correct choice and update her knowledge about the new schoolbook for the element.

With machine intelligence, we can make automated screen easy, low-maintenance, and available to any and all QA teams. & nbsp;

You can try mabl out in your own apps for free, at.

 

Public link to Angular example: & nbsp; & nbsp;

Public link to tally React example: & nbsp;

Use mabl for free

Quality Engineering Resources

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free