Sitemap

Case Study: Leveraging Dynamism in Automated E2E Test Scripts with Ruby

How Ruby’s dynamic features reduce boilerplate and enable flexible, easier-to-maintain E2E test scripts

3 min readOct 4, 2025

--

Press enter or click to view image in full size

Non-Medium Members can read this article for free on the “The Agile Way Substack Newsletter”.

Ruby is a 100% object-oriented dynamic programming language (while Java is not), everything in Ruby is an object.

1.class            #=> Integer
"23".class #=> String
[4, 5, 6].class #=> Array

For test automation engineers: in Ruby, you don’t need to worry about data types as you would with static type checking in compiled languages.

Let me illustrate with an example. Below is an API test script. As we know, a significant portion of API test scripting involves generating test data.

def generate_customer(email)
result = Customer.new(email: email,
first_name: Faker::Name.first_name, last_name: Faker::Name.last_name)
return result
end

it "API Testing: create customer" do
customer_json = generate_customer("a@agileway.com.au").to_json
# invoke API with the above payload
end

The generate_customer function can generate a random customer, using the “Faker” library.

--

--

No responses yet