Member-only story

Why Do Most UI Test Automation Fail? (Part 3: Wrong Scripting Language)

Some languages are not suitable for UI test automation, such as Java, C#, and JavaScript. Use Ruby instead.

Zhimin Zhan
7 min readApr 27, 2021

Update 2023–02–20: Correct a Common Misconception: “Using the Coding Language for End-to-End Test Automation”

A scripting language in the context of test automation is a language syntax used in automated test scripts. Commonly, the automated test scripts are in the following three language syntaxes:

  • Compiled Programming Language, such as Java and C#
  • Scripting Language, such as Ruby and Python
  • Text-based syntaxes (top tier), such as Gherkins (Cucumber) and FitNesse

Right Choice: Scripting Language. However, 90+% would choose wrongly

The correct choice, of course, is Scripting Language. We call test scripts for a good reason, i.e. test scripts shall be written in a scripting language, such as Ruby and Python. However, most software projects make wrong choices. Before I get into the reasons, let’s consolidate the correct choice first.

  1. Ruby, Experts’ choice

The two authors of the classic “Agile Testing” book listed objective criteria for choosing Ruby. Please use them (highlighted in green) when judging whether a language is suitable for functional automated tests.

As a Test Automation and CT engineer with over 15 years’ hands-on experience (and experienced programmer in Java, JavaScript, and C#), I totally concur that Ruby is the best test scripting language, period. This has also been confirmed by many manual testers/business analysts whom I mentored.

2. Ruby has a long history as a tester-friendly language

Below are some Ruby test statements:

['male', 'female', 'other'].sample # <= get a random one from a list
page_text.scan(/Wise/).count # <= find occurrences
driver.close unless…

--

--

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