Category: Tools

This will contain some useful tools for automation. We will also review the tools

mabl’s Adaptive Testing with Angular and React Apps

Test automation can automate some repetitive, but necessary tasks. But if you’re not careful, you can quickly fall into the rabbit hole of chasing failing tests and lose sight of the equally necessary exploratory questions: “Can our users easily complete the user journey?” “Are there potential bugs with this journey?” “Is the quality of this journey regressing?”

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

A machine-learning-driven testing solution like mabl handles apps with dynamic UIs to help testers focus on the human side of testing, which makes the testing role so unique and powerful in the first place.

“I trained a few journeys in my Angular app that required unique 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 built into her test adaptation ability.

 

What information does mabl use to enable robust, adaptive tests?

As testers interact with the mabl trainer to create a test, under the covers, mabl captures your user journeys using our own proprietary domain-specific language. She also gathers a great deal of DOM element attributes, properties, and visual details (like XPaths, tag names, class attributes, text, and various contextual identifiers) to help identify conceptually equivalent elements in future test runs of the journey.

So now that she has an understanding of the user journey, as well as all this additional information, mabl knows enough about each action in the journey to identify the appropriate element again, or find likely replacements for it as the UI changes. When there’s only one likely candidate available, mabl will incrementally update her models for the corresponding step of the journey, so tests will stay up to date even after several successive UI changes.

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

But the question is regarding robust changes; can mabl still adapt? What does mabl do when there’s no obvious right answer?

mabl uses the collected information to be experimental. Based on past identifications of elements, she can rank partial and uncertain matches. To verify if the experimental action was correct, mabl evaluates how the remainder of the journey unfolds.

For example, she considers whether assertions pass, whether she can complete subsequent actions, and the visual appearance of the resulting app state compared to previous runs. If mabl determines that her fix for the test was successful, she’ll let you know what the proposed fix was. From here, you can simply reject mabl’s fix for the journey if it was incorrect, and mabl will remember that for future runs. 

Enough talk, let’s see an example of this in Angular!

As mentioned at the onset, one of the difficulties with handling a variety of modern web frameworks like Angular and React is that they rely heavily on DOM manipulation and JavaScript execution. In particular, the DOM elements generated by these frameworks often include minimal and opaque attributes, making them hard to distinguish.

However, humans must be able to recognize how to take a particular action across iterations of the UI; mabl gathers some of the same contextual clues. Although element attributes may be insufficient to identify a particular element for interaction during a journey, there are a variety of other dynamic or computed properties to be used, like inner text and rendered location or size.

Consider a simple example of a dynamically generated list in an Angular app with ngFor (similarly with ng-repeat in AngularJS 1.x or an array of generated list elements in React):

angularAppList_1.png

 

In this example, we have a screen that shows a list of user roles in a hypothetical app where each role can be clicked to get a detailed description of the role. This gets instantiated as a series of list (<li>) elements, each containing an anchor (<a>) element with the clicks handled by Angular — the href attribute of each anchor is the same, self-referential, “#” value even though a click results in displaying a different role description for each through DOM manipulation by Angular JavaScript code. Just considering the element attributes, each element looks identical (e.g., <a _ngcontent-c5 href=”#”> or just <a href=”#”> in React), but the inner text of each differs.

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

TrainingMablAngularExample-1.png

 

Below you’ll find the test output from the mabl app. You can see her collecting information at each step of the journey, then completing the test successfully (accompanying screenshots that mabl collects of the app at each step are shown on the right):

mablSuccessfulFirstRun.png

 

So when our hypothetical 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 inner text properties of the anchor elements, and updates what she knows about that element.

mablTestOutputA3.png

 

If the names of the roles were later changed (e.g., “B.0” becomes “Beta-Zero”), mabl would know that the correct element was last seen in the 4th position of the list (both by visual location and by last known XPath). So she would rank the “Beta-Zero” link as the most likely candidate and evaluate the rest of the journey to determine that she had made a correct choice and update her knowledge about the new text for the element.

mablTestOutputAbgularBetaZero.png

 

With machine intelligence, mabl makes automated testing easy, low-maintenance, and available to every QA team. 

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

 

Public link to Angular example:
https://stackblitz.com/edit/mabl-angular-list-example?file=app%2Fapp.component.ts

Public link to corresponding React example:
https://stackblitz.com/edit/mabl-react-generated-array-example?embed=1&file=index.js

Test Design Studio 2.0 a best abstraction of QTP IDE

I have been working in QTP for more than 5+ years as of now, but the pain which I have with QTP is the IDE itself.

Even though I am good new VBScripting, sometimes if I make any silly mistakes, QTP has got no options to report the syntax error, similarly it has got no code metrics, intellisense is not very intelligent enough to show all the underlying methods.

Thankfully I came across a tool called Test Design Studio 2.0, designed by Patterson Consulting, which has lot of options, the one which is available in Visual Studio IDE and Eclipse IDE.

Here are some lines from Test Design Studio

Patterson Consulting’s Test Design Studio is an exciting product that is the first of its kind for Mercury/HP automation. This product serves as an integrated development environment (IDE) for QuickTest® Professional scripts, VBScript files, Quality Center workflow scripts, WinRunner® scripts, and GUI Map Files. Extensive support for Quality Center assures tight integration with the tools you use.

If you write QuickTest® Professional test scripts or libraries, you need to realize that you are a programmer! Even though these scripts are used for testing purposes, rest assured that you are creating program code. Just like the program code that goes into the applications under test, the code used for test automation needs to possess similar quality characteristics. The sooner you treat test automation as a development activity, the sooner you will realize the cost-saving potential of this technology!

Our Test Design Studio product was the first product on the market to treat QuickTest® automation as a programming activity. The rich integrated development environment allows automation engineers to reach new levels of productivity.

Here are the Features of Test Design Studio 

Real-time Syntax Checking and Static Language Analysis

Full-featured IntelliSense

Code Metrics

Error List Tool Window

Documenter

You can download the tools for Trail version from here.

Test Case Migrator Plus

Test Case Migrator Plus tool allows test related artifacts, present in Excel and MHT/Word formats, to be imported into Team Foundation Server. It works with both Visual Studio 2010 and Visual Studio 11 (Beta).

The tool contains 2 workflows, the Excel based workflow and the MHT/doc workflow, each of which is described below:

Excel based workflow:

  • Migrates Test case information (along with Test Steps) present in Excel into Team Foundation Server – This is a ONE way migration only.
  • Migrates work items belonging to Requirement/User story and Bug work item types present in Microsoft Excel into Team Foundation Server – This is a ONE way migration only.
  • Supports multi-pass migration process – i.e., each work item type has to be migrated in a different invocation/session of the tool.
  • Maintains links between work item types (Parent/Child, Related, Tested By, Tests etc) across multiple passes.
  • Provides ability to create Test suites for a test case work item type.
  • Provides a wizard based UI to run the tool one Excel file in a single run.

MHT/Doc based workflow:

  • Migrates Visual Studio 2005/2008 manual test templates present in MHT/doc formats into Team Foundation Server – This also is ONE way migration only.
  • Provides a wizard based UI to run the tool iterating over multiple MHT/Doc files within a folder in a single run.

Capabilities common to both Excel and MHT/doc workflows:

  • Provides a command line support to run the tool in a batch mode.
  • Allows you to save your selections/configurations into a settings/mappings file to be reused later.
  • Default settings/mapping file that works across AGILE, CMMI and SCRUM based projects is shipped along with the tool.

These capabilities allow you to reap all the benefits associated with Test Case Management (requirements traceability, test coverage, requirements coverage, test execution, test result analysis etc) present in Visual Studio 2010 / Visual Studio 11 (Beta) post migration.

For more information and download,checkout the link from here

Thanks,

Karthik KK

Fiddler

Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect traffic, set breakpoints, and “fiddle” with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Fiddler is freeware and can debug traffic from virtually any application that supports a proxy, including Internet Explorer, Google Chrome, Apple Safari, Mozilla Firefox, Opera, and thousands more. You can also debug traffic from popular devices like Windows Phone, iPod/iPad, and others.

I like this tool very helpful because, it lets any person, needless of automation engineer, even a developer, manual test engineer to debug and trace the traffic going in and out between your browser and the webserver.

You can download fiddler from here

Thanks,

Karthik KK

Caffeine

If you have problems with your PC locking or going to sleep, caffeine will keep it awake. It works by simulating a keypress once every 59 seconds, so your machine thinks you’re still working at the keyboard, so won’t lock the screen or activate the screensaver.

The icon is shown above – it’s the leftmost one in the task tray, and this is all you see. Double-clicking the icon empties the coffee pot (that’s what the icon is) and temporarily disables the program. Double-clicking it again refills the pot, and will keep your machine awake.

By default the app starts enabled, and works every 59 seconds. There are some command line switches you can use to alter this behaviour:

  • xx – where xx is a number which sets the number of seconds between simulated keypresses. This must be the first text on the commandline
  • -startoff – application starts disabled.
  • -exitafter:xx – application will terminate after xx minutes
  • -activefor:xx – application will become inactive after xx minutes
  • -inactivefor:xx – application will become active after xx minutes
  • -appexit – terminates current running instance of application
  • -appon – makes the current running instance of the application active
  • -appoff – makes the current running instance of the application inactive
  • -apptoggle – toggles the running state of the current running instance of the application
  • -replace – closes the current running instance, replacing it
  • -noicon – does not show a task tray icon
  • -useshift – simulate the shift key instead of F15
  • -showdlg – shows a dialog indicating whether caffeine is active

This tool is very helpful while we need to run our automation without letting our computer to sleep even after hours !!!

You can download Caffeine from here

Thanks,

Karthik KK