Member-only story

Expose a Common Lie, “Selenium is Flaky”, Part 2: Clarify ‘automated waiting’

The reason behind ‘flakiness’ is waiting. ‘Automated Testing’ is not that good, there is a much better and simpler solution.

Zhimin Zhan
9 min readFeb 1, 2023

This article is one of the “IT Terminology Clarified” series.

From Part 1, sensible people should agree that Selenium is not flaky, it is the test script issue. In other words, it is to do the tester’s capability.

The so-called “flaky” issue is all about waits in test scripts. AJAX and the use of JavaScript make web pages dynamic. This surely adds some challenges to web test automation because we need to check certain operations whether completed in the test scripts. If an operation, e.g. a payment, takes longer than expected, the next assertion for the receipt number will fail.

By the way, Selenium has two mechanisms to handle the waits: Implicit and Explicit Waits. Again, Selenium is not the issue. But, don’t forget most automated testers are fake (not believing, read this article, One Simple Test Automation Scenario Interview Question that Most Candidates Failed), fake automated testers often actively seek excuses. To them, after failure, a logical way is to switch to another framework, giving them extra time to work fakely.

To match the needs of fake automated testers, some bad frameworks, such as Cypress, come to the market, claiming “automatically waits for elements to become visible”[link], and similar stuff from TestCafe.

Table of Contents:
· Did you ever witness a single successful test automation with Cypress, TestCafe or Puputteer?
·
The story of a Principal Software Engineer's fear of me showing Selenium handling dynamic JS/AJAX
·
Clarify Waits
Selenium's way of handling waits
So-called “Automated Waiting”
·
Why I don’t use “Automated Waiting” then?
A Simpler Alternative

Did you ever witness a single successful test automation with Cypress, TestCafe or Puppeteer?

--

--

Zhimin Zhan
Zhimin Zhan

Written by Zhimin Zhan

Test automation & CT coach, author, speaker and award-winning software developer. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.

No responses yet

Write a response