Optimize Selenium WebDriver Automated Test Scripts: Readability

Simple techniques to make automated tests readable for the whole team

Zhimin Zhan
Geek Culture
Published in
6 min readJun 29, 2021

--

Working automated test scripts is only the first test step to successful test automation. As automated tests are executed often and the application changes frequently, it is important that test scripts need to be

Fast
Easy to maintain
Easy to read

Programmers (with rare exceptions) usually write poor automated test scripts. The main reason is that they forgot that, different from unit/integration tests, the audience of functional tests is the whole team, including business analysts, manual testers and customers.

In this article, I will show you some simple and practical tips to enhance the readability of automated functional tests. Please note, we must not go for readability at the price of maintainability. If the automated test scripts are not maintainable, test automation simply fails (unless for fake demos).

Gherkin syntax, e.g. Cucumber or SpecFlow, is bad, as it is almost impossible to maintain. Please read my other article, “Why Gherkin (Cucumber, SpecFlow,…) Always Failed with UI Test Automation?” Even for readability, Gherkin is not good as many thought…

--

--

Zhimin Zhan
Geek Culture

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