Why Do Most UI Test Automation Fail? (Part 3: Wrong Scripting Language)
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.
- 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.
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