Be Lazy, Stay Creative, Automate The Web

The web helps us manage interactions and exchange messages. In many cases, these interactions happen from machine to machine. Sometimes we (humans) become the machine. If you have been working in a web agency, you know that. How many hours did you spend testing a website? Browsing each page one by one to check if everything was working accordingly to the notebook. How many times did you have to repeat the same process for checking the Web site for each release, each version of the back-end before pushing the site on production?

Today, Stuart Knightley published an article on how to use OperaWatir. OperaWatir is a tool to control the Opera browser with Ruby scripts. Opera has been using OperaWatir for testing the implementation of our browser engine on many different platforms. This tool can be used in other contexts.

Computers are good for repetitive tasks, let’s use them.

Web Agency Quality Assurance Team

Use OperaWatir for testing all features of a Web site before deployment

In my previous life, I worked for a web agency in Montréal called Pheromone. To better serve their clients, the agency started to build a strict QA process. A website's code is committed to a revision control system on a development server, then branches are pushed to Quality Assurance for control. Once the Web site has been checked in QA, it is pushed on a staging server for final agreement of the client, before being pushed on the production server, the public release.

Many of these tasks involve repetitive human interactions. For example, when you design a social network site, you might want to test things like

  • Log in/Log out
  • create account/delete account
  • fill the profile form
  • modify the profile
  • post/delete a message
  • create a group
  • etc.

All these tasks are not interesting for a human being when done for each releases. They become boring and then they lead to mistakes. The employees in a company can do more creative stuff than just pushing buttons. They also take a lot of time which ends on your client billing and finally make the business less competitive than those with lower quality requirements. Pheromone used automated testing for some of these repetitive tasks.

Web Agency Deployment Team

Use OperaWatir for automating the creation of an environment

This scenario is very similar to the QA one. In a deployment chain, some CMS lack features to automate the process of making database backups, creating a clean install of a system with some specific parameters, etc. The developer or the operations engineer have to spend time in front of the browser pushing buttons in a Web UI to deploy the product. Once again, it is not a very interesting task and a loss of time. We have better things to do. All of these could be handled by controlling the browser with a few Ruby scripts using OperaWatir.

API-less Web sites

Use OperaWatir for grabbing web data automatically and recurrently

There is always this cool website which has interesting data or content. Unfortunately, the site has no feeds, no API giving an access to data under a form which doesn’t require to go check on the Web site itself. Here are a few scenarios when web automation helps:

  • You might want to check every day the price of a flight ticket and send an alert when it reaches a reasonable price.
  • Send the cinema schedule of a Web page by email every week or create a schedule of things you could do tonight with information collected every day on different sites.
  • Grab the main news of your favorite online newspapers and aggregates it in one document.

These are often doable with website scraper going through the HTML code, but there are cases where the links and content are inaccessible because of scripting. OperaWatir offers a way to access what the browser sees. It becomes easier for someone to create a script to access this information.

What about you?

Tell us in the comments or on your blog about the way you are using or will use OperaWatir. Be creative and do not lose time with repetitive tasks.