Member-only story
Why I Prefer Ruby As E2E Test Automation Scripting Language? Part 2
More suitable for E2E testing
Non-Medium Members: You can read this article free on Substack.
In Part 1, I explained some of Ruby’s great features as in general scripting. In this article, I will go a bit deeper in the context of E2E Test Scripting.
7. Dynamically locating file
In compiled languages such as Java, referring to relative files is not straightfoward, including it in CLASSPATH. This might be fine for code. But for E2E testing, referring to test data (files) is rather common, the dynamic-ness of scripting language is clearly advantaged here.
8. Less restrictive on single quoted string
In compiled languages such as Java, there is distinct difference between single quoted (character ‘a’) and double quoted strings (string “a”).
In E2E testing, QA engineers rarely need to worry about the single character data type, because our end-users don’t care. While there are still differences between ''
and ""
in Ruby, at many cases, we can use it freely, such as send_keys('testwise')
or send_keys("testwisely)"
.
9. Ruby Mixins
Besides inheritance (in OO), Ruby supports Mixin to enhance code reuse. Again, Ruby make it easy to be used in E2E test scripts. For example, in nearly every one of my father’s E2E test scripts, has…