Selenium IDE Tutorial for Beginners

What is Selenium IDE?

Selenium IDE (Integrated Development Environment) is the simplest tool in the Selenium Suite. It is a Firefox add-on that creates tests very quickly through its record-and-playback functionality. This feature is similar to that of QTP. It is effortless to install and easy to learn.

Because of its simplicity, Selenium IDE should only be used as a prototyping tool, not an overall solution for developing and maintaining complex test suites.

Though you will be able to use Selenium IDE without prior knowledge in programming, you should at least be familiar with HTML, JavaScript, and the DOM (Document Object Model) to utilize this tool to its full potential. Knowledge of JavaScript will be required when we get to the section about the Selenese command "runScript."

Selenium IDE supports autocomplete mode when creating tests. This feature serves two purposes:

Features of Selenium IDE

 

Introduction to Selenium IDE

Menu Bar

It is located at the top most portion of the IDE. The most commonly used menus are the File, Edit, and Options menus.

File menu

Introduction to Selenium IDE

 

Introduction to Selenium IDE

 

Edit Menu

Introduction to Selenium IDE

 

Introduction to Selenium IDE

 

Introduction to Selenium IDE

 

Options menu

It provides the interface for configuring various settings of Selenium IDE.

We shall concentrate on the Options and Clipboard Format options.

 

Clipboard Format

 

  • The Clipboard Format allows you to copy a Selenese command from the editor and paste it as a code snippet.
  • The format of the code follows the option you selected here in Clipboard Format's list.
  • HTML is the default selection.

For example, when you choose Java/JUnit 4/WebDriver as your clipboard format, every Selenese command you copy from Selenium IDE's editor will be pasted as Java code. See the illustration below.

Introduction to Selenium IDE

 

Selenium IDE Options dialog box

You can launch the Selenium IDE Options dialog box by clicking Options > Options... on the menu bar. Though there are many settings available, we will concentrate on the few important ones.

Introduction to Selenium IDE

 

Introduction to Selenium IDE

 

Base URL Bar

Introduction to Selenium IDE

 

Introduction to Selenium IDE

 

Toolbar

  Introduction to Selenium IDE Playback Speed. This controls the speed of your Test Script Execution.
Introduction to Selenium IDE Record. This starts/ends your recording session.  Each browser action is entered as a Selenese command in the Editor.
Introduction to Selenium IDE Play entire test suite. This will sequentially play all the test cases listed in the Test Case Pane.
Introduction to Selenium IDE Play current test case. This will play only the currently selected test case in the Test Case Pane.
Introduction to Selenium IDE Pause/Resume. This will pause or resume your playback.
Introduction to Selenium IDE Step. This button will allow you to step into each command in your test script.
Introduction to Selenium IDE Apply rollup rules. This is an advanced functionality. It allows you to group Selenese commands together and execute them as a single action.

 

Test Case Pane

Introduction to Selenium IDE

  • In Selenium IDE, you can open more than one test case at a time.
  • The test case pane shows you the list of currently opened test cases.
  • When you open a test suite, the test case pane will automatically list all the test cases contained in it.
  • The test case written in bold font is the currently selected test case
  • After playback, each test case is color-coded to represent if it passed or failed.
    • Green color means "Passed."
    • Red color means "Failed."
  • At the bottom portion is a summary of the number of test cases that were run and failed.

Editor

You can think of the editor as the place where all the action happens. It is available in two views: Table and Source.

Table View

Introduction to Selenium IDE

 

 

Logs can be filtered by type. For example, if you choose to select the "Error" option from the dropdown list, the Log Pane will show error messages only.

Introduction to Selenium IDE

 

Reference Pane

The Reference Pane shows a concise description of the currently selected Selenese command in the Editor. It also shows the description about the locator and value to be used on that command.

Introduction to Selenium IDE

 

UI-Element Pane

The UI-Element is for advanced Selenium users. It uses JavaScript Object Notation (JSON) to define element mappings. The documentation and resources are found in the "UI Element Documentation" option under the Help menu of Selenium IDE.

Introduction to Selenium IDE

An example of a UI-element screen is shown below.

Introduction to Selenium IDE

 

Rollup Pane

Rollup allows you to execute a group of commands in one step. A group of commands is simply called as a "rollup." It employs heavy use of JavaScript and UI-Element concepts to formulate a collection of commands that is similar to a "function" in programming languages.

Rollups are reusable; meaning, they can be used multiple times within the test case. Since rollups are groups of commands condensed into one, they contribute a lot in shortening your test script.

Introduction to Selenium IDE

An example of how the contents of the rollup tab look like is shown below.

Introduction to Selenium IDE

Summary

The following table summarizes the release history for the Selenium IDE.

Major version Release date
1.0.10 06-Dec-10
1.5.0 15-Dec-11
1.8.1 01-Jun-12
2.1.0 30-Jun-13
2.2.0 06-Jul-13
2.3.0 09-Aug-13
2.5.0 02-Jan-14
2.8.0 29-Sep-14
2.9.0 09-Mar-15
2.9.1 15-Mar-15
3.0 11-Apr-18
3.1.0 26-June-18
3.2.0 13-Aug-18
3.4.4 15-Oct-18

 

YOU MIGHT LIKE: