When you (re-)search "artificial intelligence impacting test automation", you will find a lot of future-looking statements, how Artificial Intelligence (AI) will impact test automation. On the other hand, a lot of new tools will be appointed as AI testing tools, which have never been or seen before in test automation. This article will give you different practical examples, how AI is changing test automation and Micro Focus is leading the way... and for sure, AI is much more than only the examples of this article...
When we think about AI, we often think about it as a feature or a tool, which removes all the obstacles we face in testing, all the overload, and manual intervention, or even effort on maintenance or analysis. Obviously finding solutions to our problems through machine learning and AI to make our lives easier is our long term goal.
Most of the challenges are a huge pain for the organization and cause attention. But taking a closer look at those, the majority of the test automation challenges are execution or even post activities. Let's take a few steps back and face AI in the current state and see how it already benefits the testing process. Even in areas where we don't have the highest focus on attention. Let's see AI more as a capability, which supports us during the whole continuous testing process, especially when we look into test automation.
What is AI in the context of test automation?
To understand AI in the context of test automation, we have to understand how AI is defined in general.
According to Wikipedia, AI:
- represents the intelligence of machines in contrast to the natural intelligence by humans.
- also appointed as "intelligent agents"
- describe machines that mimic "cognitive" functions
Let's unpack the definition for a moment.
Representative intelligence similar to ours (of humans) - natural intelligence is shaped by its lifecycle throughout the age of each individual. How is a natural intelligence shaped? The shaping is part of the learning process of human brains, either by experience or by another individual (parents, friends, teachers,), etc.. Similarily AI is shaped majority through individuals (company, open-source, etc.) and experience based on the pattern of its neural network.
Mimic cognitive functions - mimic appoints here in imitating actions of someone while cognitive functions makes it more valuable for humans. In other words, providing value by acting similar to humans.
Intelligent agents - this is the most important one for us in context for test automation; AI as acting agents. The definition of an agent is "acting on behalf of another person".
We can see AI as a supportive capability that provides value by acting.
Apply AI on your test automation process
Let's take a look at the test automation process from a high-level perspective. We assume to have 5 major phases during the process.
Identify - at this stage, the testing team decides to automated test cases for (any) selected application(s). Typically the selected application is running in production.
Build - during this phase, the test automation engineer or representative scans the application to build a fundament for test automation either as a framework, reusable models, or scripts. At this stage, the application needs to be at least available on a testing instance as this is very important for the test automation engineer to understand how the technical identification of the application objects is set up. This is a time consuming and crucial phase for the test automation process.
Design - this phase now brings the reusable models or scripts together using the framework. At some organization Build & Design are performed at the same time.
Execute - at this stage, the automated tests are ready to execute. The execution takes place typically on multiple automation hosts reserved to run automated tests. On these machines, the automation framework and run time need to be configured. Testing hosts costs a lot when idling, therefore many organizations work with spin up and spin down of testing hosts when they need it. And this is also very time-consuming in concern of designing and maintaining the spin up & down approach. For cross-platform, browsers, and/or devices, the scalability becomes even more challenging.
Maintain - at this stage, the test automation engineer adopt and apply all kind of changes to the test automation framework and make sure test cases are stable. Test maintenance is one of the keys to successful test automation.
If we filter out the phases with the highest time and effort spent on, we will identify the BUILD and EXECUTE phases.
What is the reason for spending high effort and time during these phases?
Understand the time and effort spent on the BUILD phase:
- UI test automation requires the application to be available during the build phase as the technical identification of the test object is crucial for scanning and creating the framework.
- Test automation tools can not work with objects, which they technically can not identify.
- Only trained individuals can work with test automation tools and need to have a technical understanding of how to best build the test automation libraries or models.
Understand the time and effort spent on the EXECUTE phase:
- Testing hosts can only understand the test cases to run if at least a runtime is installed on the machine added to the application under test (AUT).
- Testing hosts are not easy to set up, especially open-source test automation requires different libraries for different OS, AUT, browsers, and devices.
- Spin up and spin down need to be defined and it takes time to get initiated and run.
Let's summarize our findings first before understanding how to best make use of AI. The build and execution phases are time-consuming, because of the technical limitation of test automation tools and capabilities. These limitations would not exist if a human would handle the build and execute phases. On the other hand, a human would not perform as good as a machine across hours for the same repetitive tasks.
Shift-left AI-based testing
What if we can build the test cases prior to the application is available (at all)? This would allow us to speed up the process and shift to the complete left starting test automation. Watch the following short video to understand how the BUILD phase uses mockups for test automation, even far before it exists based on interactive or non-interactive mockups.
As mockups are very useful for developers, why it is not possible to leverage it for test automation? Having the AI capabilities, allow us to automate application under test (AUT) even before they have been developed. Similarily a human is able to see a mockup and identify what kind of objects are displayed on it. It is the same behavior as a human would perform test execution using a test script and executing according to the test guidance. The human brain power will recognize the objects at run time.
Starting test automation by using mockups will accelerate the testing phase by reducing the time for manual test execution. AI can understand the context and recognize the objects on even an image (mockup). With this approach, tests can be automated without having the app even one single line of code ever written. While shifting the test automation design activities to left, will allow quality assurance teams to save time towards Go-Live. Tests are being automated using AI on mockups and can be fully utilized during the (manual) testing phase. This would reduce the time to production and allow testers to focus on more important tasks while AI is handling the automation.
Now let's examine the same for the EXECUTE phase. The majority of testing hosts are virtual machines (cloud or on-premise), it would be great if AI can leverage the testing host in the same manner as a human would do.
Today the test automation infrastructure requires a dedicated setup for test execution, which needs to be maintained continuously in order to keep the latest versions of the toolset and plugins work together and stable. Besides the test automation tools, the set of AUT(s) needs to be installed and configured as well. Each testing host acts as an isolated host with all the components deployed to run the automated tests.
While as on each testing host a test automation tool instance or run time needs to be configured next to all the AUTs, for AI-based test execution, it is not necessary to install the testing tools or runtime AND the AUT on the same testing hosts. Web access based on the browser will allow the AI engine to access the testing host with the AUT and run the test like a human. This will reduce the maintenance effort in building the test automation infrastructure.
The beauty of this approach is that for Desktop AUTs via web-based browser access to the testing host, AI can recognize the AUTs on a cross-platform (Windows, Mac, Linux).
The testing hosts won't act as isolated hosts anymore and will share the apps across testing hosts.
Why web-based browser access for remote desktop connections?
The explanation is simple. Browser-based access does not require and installation or plugin more libraries and work cross-platform. This way it is easier to access machines of the different operating systems using the AI capabilities. This can allow for instance running a UFT desktop GUI Test (which is only windows based) on a Mac or Linux UI for the same AUT (example Java App).
The following web-based browser access could be tried out:
- Chrome RDP
- VMWare Horizon web access
- Skytap browser access
Run UFT AI tests on a desktop application
In the following short video, we will demonstrate how a possible use case could look like using the current capabilities of UFT AI (version 15.0.1) on desktop applications. We will use a UFT client machine to connect to a windows environment using skytap web access with Firefox. On that remote windows machine, there is no UFT installed. Using UFT AI we will run a short automated test on a Windows Presentation Forms (WPF) [FlightGUI.exe] to book a flight order.
Please note that this is not an official supported feature nor approach, it is part of the content delivered within and by the community forums within Micro Focus.
As we have seen, Micro Focus UFT One can leverage AI features to run desktop automation even on client machines that do not have UFT One or UFT run time installed at all. The test automation is running a test like a human would to using a supportive AI engine which creates value by its action.
This is just the start of many more investigation areas of AI and a completely new direction of independent AI-driven test automation approach, which is not tied to any technical locators or installations on different environments.
Micro Focus UFT comes with an Artificial Intelligence (AI) integrated and allows SAP Fiori apps to be tested using AI. To learn more about it check out this guide.
- Accelerating SAP Fiori Application Testing using UFT AI features: https://community.microfocus.com/adtd/b/sws-alm/posts/accelerate-testing-towards-sap-fiori-transformation-using-uft-artificial-intelligence
- Shift left testing using UFT Artificial Intelligence: https://community.microfocus.com/adtd/b/sws-alm/posts/shift-left-testing-using-uft-artificial-intelligence
Try it out yourself, download UFT One and its artificial Intelligence today: https://www.microfocus.com/en-us/products/uft-one/free-trial