Free Test Automation Practice Site with Database Reset
Data reset will help you to write automated tests much easier
Learning raw Selenium WebDriver is easy, very easy. After attending my one-day training session, the participants would be able to write maintainable selenium tests for common test scenarios. They often asked me: “What’s the next step?”. My answer: “Do more simple Selenium practices like the ones in the ‘Selenium WebDriver Recipes in Ruby’ book, then use it at work, make it real.” I could sense their hesitation which is easy to understand. Most of the training participants had seen failures of test automation attempts by tech leads/external contractors repeatedly. They did not want to use the newly learned skills at work unless they were really confident.
Therefore, I would suggest they practice on a demo site. The site cannot be too simple, like my teaching site: https://travel.agileway.net.
Ideally, it shall be a real modern site with features such as:
Modern (such as in Material Design)
Dynamic (JavaScript and AJAX)
Responsive (works on smartphones, iPad, and computers)
File Upload/Download
Google/Facebook integration (authentication, map)
Modal popups/alerts
Common business features, such as user login, sign-up, user management, searching/filtering, invoicing, calendar, reporting/charting, …, etc
and it is suitable for practising:
Can log in with different roles
The owner of this site does not mind the traffic
Free
Most testers would understand the above needs. However, there is an important feature many did not realize: Database Reset. Let me illustrate with a simple test scenario: “Add a user”. The test design is as below:
Login as ‘Admin’
Create a User with a random username
Verify that now there are +1 users in the system.
Is that correct? No! Assuming that the system has 5 users. After one test execution, the assertion is checked for 6. But this assertion would fail on the next run, as the number would be 7 then. Adding the step below would correct it.
4. Delete the newly created user
However, this test design is still not optimal as it assumes the tester is the only user of the system at the time. This is a different topic (parallel execution) which I will cover in a future article. For now, let’s say the test design is OK.
A far better (and simpler) solution, if can be implemented (by developers), is Database reset. That is, at the beginning of test execution, somehow resets the system to a known state. Let me show a live example, the WhenWise Sandbox site: https://whenwise.agileway.net
Log in (with a seeded user account)
2. Click ‘Professionals’, you can see there are 3 of them.
3. Delete one of them, “Luke Murry”.
4. Visit “/reset” (web address: https://whenwise.agileway.net/reset) to invoke a database reset, which usually takes under 1 second.
Visit the “Professionals”, Luke Murry is back.
Database Reset will make both automated and manual testing easier, a lot easier.
The database reset in the WhenWise sandbox works for most data, not just ‘professionals’ as in the above example. This will help you to write tests easier.
Most of the WhenWise acceptance tests (in Selenium RSpec) start with a database reset like the below:
before(:all) do
@driver = Selenium::WebDriver.for(:chrome, browser_options)
@driver.navigate.to(site_url)
visit("/reset") # reset the database
end
Here it is. The WhenWise sandbox (https://whenwise.agileway.net) is available free as a test automation practice site. To make it work better with multiple sessions, a limit of 30 minutes for database reset is allowed for the same IP address, i.e., others won’t be able to invoke another database reset during your ‘exclusive use’ time.
Unlike many practice websites, WhenWise is a real app where people make daily bookings on its production server. I have developed (and maintained) ~500 Selenium tests for WhenWise (as the regression suite) which are executed in my BuildWise CT server to enable daily releases. If you are ambitious, challenge yourself with this goal: Level 2 of AgileWay Continuous Testing Grading (50 automated end-to-end tests), in my opinion, which makes you one of the top 1% of test automation engineers.
Other Resources: David Mello put up an article with a good collection of practice sites: “Best Websites for Practicing Test Automation”, a good collection, but no support for Database Reset.