Advanced usage of Selenium IDE for web automated testing

10 Feb, 2017 | 3 minutes read

Summary

This article gives an overview of Selenium IDE’s main features and its architecture, while the linked document describes in detail how Selenium IDE is used as a full-featured regression test automation tool.

Selenium IDE is a “lightweight” full-featured test automation tool for quick jumps in test script creation, record and playback fundamental, regression testing and many other features.

What is Automated Testing?

Many of today’s software applications are written as web-based applications run in an Internet browser. The effectiveness of testing these applications varies widely among companies and organizations. In an era of highly interactive and responsive software processes where many organizations are using some form of agile methodology, test automation is frequently becoming a requirement for testing software.

Test automation means using a special software tool to run and control repeatable tests against an application and to compare actual with expected outcomes.

One of the most popular and useful tools for web test automation is Selenium IDE.

Introduction

Selenium IDE is an integrated development environment for developing Selenium web-based tests. It is an open-source automated testing tool, implemented as a Firefox extension.

Selenium IDE provides an efficient way to:

  • Record and playback tests
  • Save and export test cases and suites
  • Compare expected values with actual values

The tool simulates clicks and validation on a web page or a web application. It does that by interacting with previously recorded elements on the web page. It also contains a context menu that allows selecting a UI element from the browser’s displayed page and then selecting a Selenium command from a list with pre-defined parameters.

Selenium IDE has an easy extension and customization plugin system that includes:

  • Changing existing functionality
  • Adding new functionality to the API
  • Custom formats and export capabilities
  • Hosting of plugin update.rdf files
  • Adding new locator strategies (coming soon)

Why Should We Use Automated Testing?

Test automation with Selenium IDE has specific advantages for improving the long-term efficiency of a software testing process.

The main reasons why automated testing should be used are:

  • Frequent regression testing
  • Finding defects missed by manual testing
  • Faster than human testers
  • Reduces human errors
  • Cheaper to run and maintain
  • Exposes defects to the development team faster
  • Improves communication between groups
  • Support for Agile and extreme development methodologies
  • Easy way to export and compare test results

Architecture & Workflow

The tests in Selenium IDE are recorded in an HTML table-based architecture using keywords. The code can be exported in different languages, like Ruby, Java, C#, etc.

Selenium IDE Architecture
(Image 1 – Selenium IDE Architecture)
Selenium IDE Workflow
(Image 2 – Selenium IDE Workflow)
Exporting Selenium IDE tests
(Image 3 – Exporting Selenium IDE tests)

In the diagram below creation and execution flows of the test suite & test case are presented.

Create and Execute Workflow
(Image 4 – Create & Execute Workflow)

Features

There are so many features, which a Selenium IDE aims to provide. Selenium supports autocomplete mode for test creation and this feature serves two purposes:

  • It helps the testers use and enter pre-defined commands more quickly
  • It restricts the user from entering invalid commands

Some of the main features of the Selenium IDE tool are:

  • Easy way to record and playback tests
  • Intelligent field selection using IDs, names, or XPath as needed
  • Autocomplete for all common Selenium commands
  • Walk through tests, Debug, and set breakpoints
  • Save tests as HTML, Ruby scripts, or any other format
  • Support for Selenium user-extensions.js file
  • Option to automatically assert the title of every page
  • Easy customization through plugins
  • Support for exporting the test results

The Selenium IDE tool provides a rich set of commands for fully testing a web app in virtually any way. Selenium commands come in three categories:

  • Actions (commands that generally manipulate the state of the application)
  • Accessors (examine the state of the application and store the results in variables)
  • Assertions (verify that the state of the application conforms to what is expected)

Conclusion

Let’s sum up key advantages and reasons why to use the Selenium IDE tool for test automation:

  • Selenium IDE is very simple and easy to use and it is flexible for the users
  • It has the capability to convert a test to different programming languages
  • Selenium IDE provides Logging capabilities
  • In Selenium IDE, the user can debug and set breakpoints
  • No programming experience is required to use this tool

However, automated front-end testing cannot cover all possible scenarios, in this case, manual testing is inevitable.

If you want to read more about this tool, here you can download the full article.