Selenium at scale: Managing flaky tests in fast-moving Devops teams 

In the relentless pace of modern DevOps environments, where continuous integration and deployment pipelines demand rapid feedback cycles, flaky Selenium tests have emerged as one of the most frustrating barriers to development velocity. These unpredictable tests that pass or fail randomly can bring entire CI/CD pipelines to a grinding halt, forcing teams to choose between speed and quality. 

According to recent industry research, flaky and unstable tests pass or fail randomly, often due to hardcoded waits or not waiting for the full page load. Google’s internal research revealed that 84% of the test transitions from Pass → Fail were from flaky tests, with between 2–16% of their compute resources spent on re-running flaky tests. This represents a staggering waste of both time and computational resources that modern development teams simply cannot afford. 

For fast-moving DevOps teams operating at scale, traditional Selenium-based approaches increasingly reveal their limitations. While Selenium remains a powerful tool for web automation, its inherent dependencies on DOM structures, timing synchronisation and browser-specific behaviours create fragility that escalates exponentially in complex enterprise environments. This is where T-Plan offers transformative alternatives through our image-based automation approach, providing stability and reliability that traditional DOM-based testing simply cannot match. 

Compatibility testing

Table of Contents

Understanding the flaky test epidemic in DevOps 

Flaky tests represent more than just an occasional inconvenience, rather, they constitute a systemic threat to DevOps efficiency and software quality. An unstable test, sometimes referred to as a Selenium test “flaky test case” or “unstable test,” is a test that, even in cases where the code being tested remains unchanged, yields inconsistent or unpredictable results after several test runs. 

The impact of flaky tests extends far beyond individual test failures. In DevOps environments where automated pipelines depend on test results to gate deployments, flaky tests create a cascade of problems. Flaky tests can erode the overall trust in tests. They can encourage testers to overlook test failures and dismiss actual defects by ignoring them as an outcome of test flakiness. This phenomenon creates a vicious cycle where real bugs slip through because teams become conditioned to dismiss test failures as “just another flaky test.” 

The computational cost of flaky tests compounds the problem. When tests fail intermittently, CI/CD systems typically retry them multiple times, consuming valuable pipeline resources and extending feedback cycles. This delay contradicts the fundamental DevOps principle of fast feedback, forcing teams to either accept longer deployment cycles or implement workarounds that compromise quality gates. 

Modern development teams operate under immense pressure to deliver features rapidly whilst maintaining high quality standards. In this environment, flaky tests represent a particularly insidious form of technical debt that accrues interest exponentially. 

 

The root causes of Selenium test instability 

Understanding why Selenium tests become flaky requires examining the fundamental architecture of web applications and the challenges inherent in DOM-based automation. In Selenium WebDriver tests, flakiness comes from lack of synchronisation: The architecture of web apps contain multiple layers. The way these layers interact influences web app performance, including network speed, HTTP handling, source rendering and computer processing resources. 

Timing and synchronisation issues represent the most common source of flaky behaviour in Selenium tests. Modern web applications are increasingly asynchronous, with content loading dynamically through JavaScript frameworks like React, Angular, or Vue.js. Selenium tests must wait for these operations to complete, but determining the appropriate wait conditions can be challenging. 

DOM structure dependencies create another layer of fragility. Selenium tests rely on element locators – XPath expressions, CSS selectors, or element IDs – to interact with web pages. When developers modify the DOM structure, update CSS classes, or refactor HTML layouts, these locators can break, causing tests to fail even when the underlying functionality remains unchanged. 

Browser-specific rendering differences compound the complexity. Each browser engine renders pages slightly differently, handles JavaScript execution with varying timing and implements web standards with subtle variations. What works reliably in Chrome might behave differently in Firefox or Safari, creating platform-specific flakiness that’s difficult to diagnose and resolve. 

Network variability and external dependencies introduce additional unpredictability. Modern applications often depend on external APIs, third-party services, or content delivery networks. When these external systems experience latency or temporary unavailability, Selenium tests may fail intermittently. 

 

How flaky tests sabotage DevOps velocity 

The impact of flaky tests on DevOps velocity extends far beyond the immediate frustration of failed test runs. These unreliable tests create a ripple effect that undermines multiple aspects of the development lifecycle. 

Pipeline blocking and deployment delays represent the most visible impact. When automated tests gate deployment processes, a single flaky test can prevent otherwise ready code from reaching production. In CI/CD processes, flaky tests may hinder the deployment of new code, requiring teams to configure pipelines to run multiple times upon failure. 

Developer context switching and productivity loss occurs when engineers must investigate test failures that turn out to be environmental or timing-related rather than genuine bugs. Flaky tests are a drain on developer time because even when they fail, they don’t necessarily indicate the existence of a bug. 

Erosion of test suite confidence creates long-term strategic problems. When teams lose faith in their automated tests, they begin to rely more heavily on manual testing or skip testing phases entirely to meet delivery deadlines. This regression to manual processes contradicts DevOps principles and reintroduces the very inefficiencies that automation was meant to eliminate. 

 

Traditional approaches and their limitations 

Development teams have evolved numerous strategies to combat Selenium test flakiness, each with varying degrees of success and significant trade-offs. Using Wait commands instead of Sleep can reduce flakiness, as Wait commands can be set to pause a test until a certain condition becomes true until a particular timeout value. 

Improved wait strategies represent the most common first response to timing-related flakiness. Teams implement explicit waits, fluent waits and custom wait conditions to synchronise test execution with application behaviour. However, crafting effective wait conditions requires deep knowledge of application internals and ongoing maintenance as applications evolve. 

Enhanced element locator strategies aim to create more stable test scripts by using more reliable identification methods. Best practices include preferring ID attributes over XPath expressions and implementing page object patterns. Whilst these practices improve test maintainability, they cannot eliminate all sources of DOM-related instability. 

Test environment standardisation attempts to reduce variability by controlling execution environments. Selenium 4 tests are inherently less flaky than Selenium 3 tests due to the standardised W3C WebDriver protocol. However, complete environment standardisation is often impractical in diverse enterprise environments. 

The limitation of these traditional approaches is that they treat symptoms rather than addressing the fundamental architectural challenges that make Selenium tests inherently prone to flakiness. 

 

Visual testing vs Selenium: a paradigm shift 

The limitations of DOM-based testing approaches have led forward-thinking organisations to explore visual testing methodologies that fundamentally change how applications are validated. This paradigm shift moves away from the fragile dependencies of element locators and DOM structures towards approaches that mirror human visual perception. 

Image-based automation fundamentals represent a radical departure from traditional Selenium approaches. Instead of relying on traditional code-based tests, image-based testing focuses on the graphical user interface (GUI) elements. It captures baseline images representing the expected visual state and compares them to the actual application state during test execution. 

Technology-agnostic testing capabilities provide significant advantages in complex enterprise environments. Image based testing is a universal approach which performs well in environments with mixed technologies and in certain cases where object oriented tools fail or lack support of a certain feature or technology. Unlike Selenium, which is inherently limited to web applications, image-based approaches can test any application that presents a visual interface. 

Reduced maintenance overhead emerges from the visual approach’s immunity to many types of application changes. When developers modify CSS classes, update HTML structures, or refactor DOM elements, image-based tests continue to function as long as the visual appearance remains consistent. 

Cross-platform consistency becomes achievable through visual testing approaches that abstract away browser-specific rendering differences. While Selenium tests must account for varying DOM implementations across browsers, image-based tests focus on the final rendered output, providing more consistent results across different platforms. 

 

T-Plan’s solution to enterprise testing challenges 

Recognising the fundamental limitations of traditional testing approaches, we, have developed a comprehensive automation platform that addresses the core challenges faced by enterprise DevOps teams. Their solution goes beyond simple visual testing to provide a complete alternative to flaky, maintenance-heavy Selenium implementations. 

Platform-agnostic automation capabilities enable us to address testing scenarios where Selenium simply cannot operate effectively. The platform provides seamless automation across web and mobile platforms, supporting Mac, Windows  and Linux environments with unified application, code and file compatibility. This universal approach eliminates the need for separate testing tools and frameworks for different platforms. 

Image-based reliability forms the foundation of our approach to eliminating flaky behaviour. By identifying interface elements through visual recognition rather than DOM manipulation, our tests remain stable even when underlying application structures change. This approach is particularly valuable for enterprise applications where UI frameworks, third-party components and legacy systems create complex DOM structures that are difficult to navigate reliably with traditional tools. 

No-code accessibility democratises test creation across DevOps teams, enabling both technical and non-technical team members to contribute to testing efforts.  Our no-code automation platforms create sophisticated test scripts without extensive programming knowledge, reducing the bottleneck of specialist automation skills whilst maintaining enterprise-grade capability. 

Remote environment testing addresses one of Selenium’s most significant limitations in enterprise environments. Many organisations operate applications in remote environments, virtual machines, or Citrix-style deployments where DOM access is limited or impossible. At T-plan, we automate GUI testing seamlessly across remote environments using RDP and VNC connections enables testing scenarios that are simply not feasible with traditional approaches. 

Data integration and workflow automation extend beyond basic UI testing to encompass complete business process validation. The platform supports automated events that use data from spreadsheets, databases, PDFs and text files with live data integration via APIs and web requests, enabling comprehensive end-to-end testing that validates entire user workflows. 

Proven enterprise success demonstrates the real-world effectiveness of our approach. With a track record spanning over 25 years and hundreds of enterprise customers, we have consistently delivered results that matter to business stakeholders. Client testimonials reveal transformative impacts: some organisations report reducing 6-hour processes to just 10 minutes, whilst others achieve savings of 1 hour per day per tester, translating to 32.5 hours per week across testing teams. 

 

Implementing stable automation in CI/CD pipelines 

Successfully integrating reliable automation into DevOps workflows requires careful consideration of both technical architecture and operational processes. The transition from flaky Selenium-based approaches to stable visual automation represents more than a tool change – it demands a strategic rethinking of how testing fits into continuous delivery pipelines. 

Pipeline integration strategies must account for the different characteristics of visual testing approaches. Unlike Selenium tests that require complex browser management and driver coordination, image-based automation can operate more independently of specific runtime environments. This independence enables more flexible deployment strategies and reduces the infrastructure complexity typically associated with browser-based testing at scale. 

Quality gates and deployment decisions become more reliable when based on stable test results. Flaky tests force teams to implement complex retry logic and manual override processes that compromise the automation benefits of CI/CD pipelines. Stable visual testing enables simpler, more reliable quality gates that teams can trust to make deployment decisions automatically. 

 

Measuring success: from flaky to reliable 

Transitioning from flaky Selenium-based testing to stable visual automation requires clear metrics to demonstrate value and guide continuous improvement. Success measurement must encompass both immediate operational improvements and longer-term strategic benefits that support DevOps objectives. 

Test reliability metrics provide the most direct measurement of improvement. Successful implementations typically see test pass rates stabilise above 95%, with consistent results across multiple execution environments. Unlike Selenium tests that might show significant variance between browsers or execution contexts, stable visual testing approaches demonstrate consistent behaviour that enables reliable quality gates. 

Pipeline efficiency improvements manifest in reduced execution times and decreased resource consumption. When tests no longer require retry logic or extensive debugging, CI/CD pipelines execute more efficiently. Organisations implementing stable testing approaches often report 30-50% reductions in overall pipeline execution time, directly translating to faster feedback cycles and improved developer productivity. 

Maintenance overhead reduction represents one of the most significant long-term benefits. Traditional Selenium test suites can require 20-30% of QA team capacity just to maintain existing tests as applications evolve. Visual testing approaches typically reduce this maintenance burden to less than 5% of team capacity, freeing resources for strategic testing initiatives rather than reactive maintenance. 

 

Future-proofing your testing strategy 

As software development continues to evolve at an accelerating pace, testing strategies must anticipate future challenges whilst addressing current limitations. The shift from DOM-based to visual testing approaches represents not just a solution to current flakiness problems, but a foundation for sustainable testing practices that can adapt to emerging technological trends. 

Emerging technology compatibility becomes increasingly important as organisations adopt new development frameworks, deployment patterns and user interface technologies. Traditional Selenium-based approaches struggle with emerging UI paradigms like micro-frontends, progressive web applications  and hybrid mobile technologies. Visual testing approaches provide inherent compatibility with any technology that produces visual output, ensuring testing strategies remain viable as development practices evolve. 

AI and machine learning integration represents the next frontier in test automation, with intelligent testing approaches that can adapt to application changes automatically. Our foundation in visual recognition provides natural compatibility with AI-enhanced testing capabilities that can intelligently handle visual variations while maintaining test stability. 

Skills and team development considerations favour testing approaches that can be adopted broadly across development teams rather than requiring specialised automation expertise. Our no-code capabilities enable sustainable testing practices that don’t depend on scarce automation specialists, supporting long-term team scalability and knowledge distribution. Contact us today to see how we can help you.  

 

Building reliability into DevOps excellence 

The journey from flaky Selenium tests to reliable automation represents more than a technical upgrade – it embodies a fundamental shift towards sustainable DevOps practices that prioritise long-term velocity over short-term compromises. The costs of maintaining flaky test suites extend far beyond immediate frustrations to encompass strategic impacts on team productivity, infrastructure efficiency  and product quality. 

The evidence is clear: traditional DOM-based testing approaches inherently struggle with the complexity and pace of modern software development. With 84% of test transitions from Pass → Fail attributed to flaky tests and up to 16% of compute resources wasted on re-running unreliable tests, the case for alternative approaches becomes compelling from both technical and economic perspectives. 

Visual testing methodologies, exemplified by T-Plan’s comprehensive automation platform, offer proven solutions to these endemic challenges. By eliminating the fundamental dependencies that create flaky behaviour – DOM coupling, timing synchronisation  and browser-specific variations – visual approaches provide the stability that fast-moving DevOps teams require. The platform’s ability to operate across any technology stack, platform, or deployment environment ensures that testing strategies remain viable as technological landscapes evolve. 

The business impact speaks volumes: organisations implementing stable testing approaches report transformative improvements in development velocity, infrastructure efficiency  and team productivity. When teams can trust their automated tests to provide reliable feedback, they make faster deployment decisions, spend less time debugging false positives  and focus their expertise on delivering customer value rather than maintaining testing infrastructure. 

T-Plan’s quarter-century of experience in delivering stable automation solutions across hundreds of enterprise customers demonstrates that this transition is not only possible but essential for organisations committed to DevOps excellence. In an era where software quality directly impacts business outcomes and competitive position, the luxury of accepting flaky tests as “part of the testing landscape” no longer exists. The tools, approaches  and expertise needed to eliminate flaky behaviour are available today. The question facing DevOps leaders is not whether to address these challenges, but how quickly they can implement solutions that unlock their teams’ full potential. If you want to find out how we can support you, contact us today. 

Recent Posts

test scripts

Are your test scripts slowing down your continuous testing pipeline? 

The promise of continuous testing lies in delivering rapid, reliable feedback that enables development teams to maintain velocity whilst ensuring software quality. However, many organisations discover that their test scripts have become the primary bottleneck in their CI/CD pipelines, transforming what should be an accelerating force into a source of delays, frustration and reduced confidence

Read More »
The Difference Between RPA and Test Automation: Why RPA Can’t Replace Testing

Is your automation framework truly data-driven or just repetitive? 

The distinction between truly data-driven automation and merely repetitive scripting represents one of the most critical decisions facing modern software development teams. Whilst many organisations believe they’ve implemented sophisticated automation frameworks, closer examination often reveals collections of hard-coded scripts that repeat identical actions with minimal variation. This fundamental misunderstanding not only limits testing effectiveness but

Read More »

When should you use emulators vs real devices in testing? 

The mobile application landscape has fundamentally transformed how businesses approach quality assurance, with over 1.43 billion mobile devices sold in 2021 alone and more than 2.65 million applications available on Google Play. This explosive growth has created unprecedented challenges for development teams who must ensure their applications perform flawlessly across an increasingly diverse ecosystem of

Read More »

Book your FREE demo

Get in touch with our award-winning team today and unlock the power of our Automated Visual UI testing tool for your business.

Book your FREE demo

You’re just one step away from saving time & money – get in touch today.

  • No code access required
  • Visual UI testing tool
  • iOS and Mac compatible
  • All platforms supported
  • Mimics real time user experience
  • Record and playback function
  • Award winning support