Repurposing Automated Scripts for Live Demonstrations
Transform Selenium automated test scripts to automation scripts
Recently, I did a presentation for a university course’s project (part-time study). To demonstrate more app features within a limited time (4 minutes), I decided to use an automated script to assist in showcasing the app.
This article will show how I flipped the automated test scripts into showcase scripts for a demo. I already created a set of automated test scripts along with development.
Zhimin: strictly speaking, the above is a test execution report on BuildWise, an international award winning Continuous Testing server I developed. TestWisely is a new cloud testing platform I am developing, curretly in Beta. My daughter quickly set up a BuildWise server to run her tests on TestWisely.
Why use automated scripts for demonstration purposes
Faster than doing it manually
Reliable
Talk with ease (highlighting the key points)
Converting existing automated script into demo script
I already had working automated test scripts. It was easy to convert them into automation scripts for demo purposes.
1. Create a new folder called showcase
2. Copy your test script over to the showcase
folder
Zhimin: The main test script folder here is
spec
. There is a good reason to create theshowcase
folder in parallel tospec
(not under it). This way, all relative referencing will still work.
3. Remove assertions from the showcase script
The showcase is just an automated script to drive the browser. We don’t need to assert text/behaviour as it’s not a test script.
4. Update/combine test scripts into the showcase script
For demonstration purposes, sometimes you want to show more than one functionality. For mine, I combined two test scripts: “logging in” and “leaving a course review” into a single showcase script.
Zhimin: The test script is based on Maintainable Automated Test Design. Most of test step implementations reside in Page Classes (POM). Therefore, it is quite easy to modify (and maintain).
Running your script
The script’s execution speed might be too quick (for the audience) to see details or for you to talk about.
You have two options:
Use
sleep
to add specific delays to the script
Not recommended. This is time-consuming and changes the script in many places.Set a delay between operations with a supported tool
In TestWise (a testing IDE)’s settings, you can set a delay. In this case, I set it to 0.3 seconds. This means there is a 0.3-second wait between each step. This will effectively slow down the execution speed and easier for the audience to follow.
Furthermore, in the same setting dialog, I ticked the "Highlight web control during execution"
option. TestWise will highlight the controls in yellow to make them obvious in demonstrations.
Below is a screencast (1min 13 seconds) of my project demonstration using the above showcase scripts & execution delay:
The demonstration went quite well. The tutor was quite impressed and asked me what the script was written in. In case you are wondering the same, the answer is raw Selenium in RSpec running in TestWise, the testing tool created by my father. I started learning test automation using TestWise when I was 12.