UI Testing for Agile DevOps Teams
UI Testing for Agile DevOps Teams
Continuous Integration
Guide to UI Testing with Continuous Integration | 1
Contents
automate UI tests testing process is just one component of the ality, prioritize them in the order of importance,
software development process. Before diving and deploy new functionality in two-week cycles.
into the details of UI testing, it's important to Stakeholders can collect user or customer feedback
understand how it fits into the bigger picture of from these smaller iterations and use it to inform
Agile development and the DevOps process. future development work to avoid working on the
wrong things.
Let's take a look at Agile development, testing
pyramids and how DevOps plays a role in both.
UI Tests & the Testing Pyramid
An Agile Development Primer
Test-driven development, or TDD, has become
Agile development is an iterative approach to one of the most important components of Agile.
software delivery focused on building incrementally According to a growing body of research, these
from the beginning rather than delivering it all at practices greatly reduce the time it takes to
the end. By breaking projects down into small deliver a software project and enhance product
pieces, prioritizing them, and continuously delivering quality by reducing the number of bugs that
them in short cycles, the process helps keep software reach production and ensuring the business
projects on time and on budget. requirements are met on a continuous basis.
For example, a developer might write a unit test could compromise product quality by removing
key safeguards.
for a given piece of functionality and won't commit
it until they write the code to make it pass. Test In the next chapter, we take a look at how to write
engineers might run integration tests based on more robust functional UI tests before moving on to
business requirements and run them with every CI/CD integrations and other more advanced topics.
Let's take a look at how to write more robust UI How to Make UI Tests Scale
tests and how TestComplete can help simplify the
process and enable more complete test coverage. There are several steps that you can take to make
functional UI tests more robust and scalable. The
How to Improve Your UI Tests key is isolating them from dependencies, accu-
rately recognizing elements, and taking steps to
Functional UI tests are challenging because the
improve maintainability over time. By investing
user interfaces tend to evolve more often than
more time at the start and using the right tools,
the rest of the codebase. For example, a small
you can save a lot of time over the long-term and
change to the class or ID of an element on a web
avoid brittle tests.
page could cause an entire test to fail if the script
used it as an identifier. It's hard for developers to Some important steps to consider include:
understand the ripple effect of these small changes.
Mocking backend servers to isolate front-end code
There are some cases where tests can be nearly and eliminate any issues with unreliable API calls
impossible to run in an automated fashion. For or other backend requests that can throw errors.
instance, you may want to run tests in a virtual
desktop (e.g. Citrix) environment with a single large Avoiding any trivial UI tests that aren't important.
image. Automating these tests may require using Every test should be either an important user
XY coordinates to identify and interact with user workflow for the business or a highly trafficked
interface elements — a time-consuming and error- user workflow.
prone approach.
Building tests that are easy to refactor by using
Unreliable UI tests are a significant obstacle to don't-repeat-yourself (DRY) principals, sensible
Agile development because it blocks high-speed variable names, and other techniques.
Looking Ahead
CI/CD pipelines example, they may have a Jenkins build server that
automatically compiles an application after each
before each deploy to a new environment.
commit and run the associated tests to check for The good news is that new technologies are mak-
errors. If there is an error, the server may reject ing it easier and faster to run functional UI tests.
the commit until the code passes the test or the For example, TestComplete dramatically cuts down
test is removed. on the time that it takes to create end-to-end tests,
while distributed testing capabilities make the tests
Let's take a look at how UI tests fit into these CI/
a lot more scalable than other testing options on
CD workflows and some best practices to keep in
the market. This means that you can run them
mind when implementing them in practice.
more frequently.
Looking Ahead
A typical bug reporting process involves that most UI-focused bug reports contain, which are
1. A new bug is discovered by a user or tester and The most important components include:
the tester writes up a bug report. | Title: A concise summary of the bug and its category.
2. The bug is assigned to the appropriate developer by | Summary: A short summary of when and how
the project manager with an appropriate priority. the bug occurred.
| Expected vs. Actual Results: A clear summary TestComplete makes bug reporting simple
of what result was expected and how what
happened differed.
| Only include one bug per issue. Don't combine can quickly collect relevant screenshots, videos,
multiple related bugs into a single issue for and console data to share with developers to help
developers to solve since they may be unrelated them reproduce and quickly diagnose bugs with-
under the surface. out having to spend as much time collecting the
material by hand.
| Search to make sure that the bug hasn't already
been reported. If it has been, check the existing In the next chapter, we take a look at cross-plat-
bug report to see if you can add any new infor- form testing strategies for applications that need
mation based on your findings. to work across mobile, web and desktop.
code. You can even customize mobile gestures and devices and resolution configurations.
Looking Ahead
other advanced UI interactions. The platform works
| Mobile: You can create and automate functional Cross-platform UI tests can be a challenge due to the
with nearly any popular software or device, eliminat-
wide range of potential configurations. While many
UI tests on physical for virtual iOS and Android
ing the need for patchwork solutions. quality assurance teams use a patchwork of solu-
devices without jailbreaking your phone.
tions, TestComplete makes it easy to keep everything
TestComplete supports most
| By supporting multiple platforms, TestComplete under one roof and integrate with external testing
major platforms:
tools, including Jenkins and Git. It’s a great way to
enables you to keep all of your functional UI tests
| Desktop: You can automate UI tests for desktop ensure maximum coverage with minimal investment.
under the same roof, making it easy to standard-
applications across a wide range of tools and con- ize testing and reporting. The ease of use also In the next chapter, we take a look at why you should
trols, including .NET, Windows 10 and Java. means that you can create more test coverage try TestComplete and answer some common questions.
streamlines UI quently change, UI tests tend to be brittle and applications, and native mobile applications.
throw a lot of false positives. There are also a large
testing number of potential browsers, operating systems,
“TestComplete improved application testing time
between 40-50%. It has helped us reduce resource
devices and platforms to test, which makes it chal-
costs by as much as $350K.” - Sandor Albert, Se-
lenging to reach complete test coverage.
nior Software Engineer, Philips Healthcare.
TestComplete alleviates these issues by handling
every aspect of end-to-end functional UI tests with- “We've been using TestComplete heavily for the last
in a single platform. Using AI-based object recogni- 3 years. Since that time we've been catching defects
tion, the platform can easily recognize UI elements earlier in the release cycle, releasing quicker and
based on their appearance rather than looking at the number of defects found post-release has dra-
classes or IDs that might change. The platform also matically dropped.” - G2 Reviewer
The platform also provides access to web pages and their elements displayed in
WebBrowser and Chromium Embedded Framework controls that reside in any
application. In other words, TestComplete supports any browser created based on
the WebBrowser and Chromium Embedded Framework controls.
2
How can I take test results from TestComplete and send
them to developers or to my boss?
| Select the desired log node in the tree on the left of the test log page (if you select
the root node, TestComplete sends the results of the whole run, if you select a
subnode, the item contains results shown by this subnode and its child nodes).
| Right-click the selected node and choose "Send via E-mail" from the context menu.
TestComplete packs the results to a Multipart Hypertext Storage file (.mht), attach
it to the email message and initiate the sending process. In addition you can also
export TestComplete results as JUnit XML that can be imported into any reporting
tool of your choice.
| Table checkpoints - verify data in tabular controls (grids, list views, list boxes, etc.)
| Mobile checkpoints - verifies that the desired image is displayed on the screen of
a mobile device.
| Region checkpoints - compare images, or searches for an image within another image.
| Web audit checkpoints - perform a quick performance, accessibility and SEO audit
of your web application or website
| Web accessibility checkpoints - perform various checks of web pages (for example,
checks for broken links).
4
Does TestComplete integrate with Continuous Integration
(CI) systems?
Yes, TestComplete integrates with all common Continuous Integration systems today,
including Jenkins.
There are several ways to allow multiple users to work on a test project simultaneously:
| Work with test projects in shared mode - Store your TestComplete project in a
network drive, and give all users access to it so that they are able to open, edit, and
run these test projects on their computers.
| Bind test projects to a source control - Add your TestComplete test projects to
your source control system such as Git so that all the needed users can access
the repository, get the needed test project files, commit changes they made to
the project files to the repository, and so on. In addition, TestComplete provides
advanced support for a number of source control systems allowing you to work
with them directly from TestComplete IDE.
6
Does TestComplete support BDD and Gherkin-style syntax?
Yes, TestComplete has a native Gherkin IDE and Cucumber engine to help you
accelerate your Behavior-Driven Development initiatives.