Basics of Selenium IDE

selenium ide

Selenium IDE:

Selenium IDE stands for (Integrated Development Environment). It is an easy and uncomplicated tool in selenium suite; it is the quickest method of creating scripts. It supports Firefox browser for record and playback purpose.

Once Selenium scheduler is launched, the importance of the results for each automated run is realized. If my File Logging plug-in for Selenium IDE is installed, you can set a file to write the log to. All the automated tests suite runs will log to the files at the same time.

Selenium IDE back-up’s autocompleting mode while creating the tests. This helps in

  • Entering the commands quickly
  • Restricts entering the invalid commands.

Features of Selenium IDE:

Menu Bar:

It appears on the top of IDE. The most familiarly used ones are the File, Edit, and Options menus.

File Menu:

  • This includes the options to create, open, save and close tests.
  • Tests are saved in the format of HTML
  • The main option is ‘Export” as it allows to turn the Selenium IDE test cases into file formats which can run on Selenium Remote Control and WebDriver
    • Export test case, exports the presently opened test case only
    • Export test suite exports all the test cases in the presently opened test suites.

As of the Selenium IDE v1.9.1, test cases can only be exported to:

  • .cs (C# source code)
  • .java (Java source code)
  • .py (Python source code)
  • .rb (Ruby source code)

Edit Menu:

  • This includes the general options like Undo, Redo, Cut, Paste, Copy, Delete and Select all.
  • The two main essential options are the “Insert New Command” and “Insert New Comment”.
  • The newly added command or comment will be placed on the top of the presently chosen line.
  • Commands are colored in black
  • Comments are purple.

Options Menu:

This offers the interface for configuring different settings. (Like ‘options’ and ‘clipboard Format’ options).

  • Clipboard Format allows copying a Selenese command from the editor and pasting the same as a code snippet.
  • The format of the code follows the option selected in the clipboard’s format list.
  • The default selection is HTML language.
    • g. if Java/JUnit4/WebDriver is chosen as the clipboards format, each Selenese command copied from Selenium IDE’s editor will be pasted as a Java code.

Selenium IDE Options Dialog Box

Selenium’s IDE options dialog box can be launched by clicking on the options on the menu bar. Although there are many settings, few important ones are:

  • Default Timeout Value: This is referred to the time that Selenium has to wait for a certain component to appear before it creates an error.
  • Selenium IDE extensions: Here the extensions can be specified to extend IDE’s abilities.
  • Base URL: This has to be checked for the Selenium IDE to remember the base URL each time it is launched. If it is unchecked it is launched with a blank value for the base URL.
  • Auto start: If this is checked, Selenium IDE instantly records the browser actions once started.
  • Location builders: Here the order of locators generated while recording is specified.

Base URL:

  • Its drop-down menu remembers all the previously used values
  • The Selenese “Open” command takes to the URL specified in the base URL.
  • Mercury tours, a web application containing a complete set of elements required for succeeding topics can be used for testing purpose.
  • The base URL is very helpful in accessing the related urls.

Toolbar manages the speed of Test script execution.

  • Record: This begins/ends the recording session. Every browser’s action is entered as a selenese command.
  • Playtest suite: This plays the test cases mentioned in the Test case pane sequentially.
  • Play present test case: plays the presently selected test case.
  • Resume/pause: resumes or pauses the playback
  • Step: Allows to step into every command in the script.
  • Apply rollup rules: Allows grouping Selenese commands and executing as a single action.

Test case pane:

  • More than one test case can be opened simultaneously
  • Shows the list of presently opened test cases.
  • Test case pane lists automatically all the test cases included once the test suite is opened
  • Presently selected test case appears in a bold font.
  • Each test case is color-coded after playback to show whether passed/failed.
  • Test case summary is mentioned in the bottom which either run or failed.

Editor: Here all the action takes place and can be viewed in:

Table view

Most of the work is done on Selenium IDE with the Table view.

  • Selenese commands are modified and created here itself.
  • Each step is color-coded after playback.
  • Name of the command should be typed in “Command”, to create the steps.
  • The dropdown list of matching commands are displayed with the entry presently typed.
  • Target (Eg: username or pwd) can be any parameter. Value is the input value for those targets.

Source view:

  • Displays the steps in HTML format (default).
  • Allows editing the script just like in a table view.

Log pane:

Displays the rum time messages while execution. It offers real-time updates about what IDE is exactly doing.

Logs are classified into:

  • Debug – Debug messages are shown up only after filtering.
  • Info- This says on which command IDE is presently working.
  • Warn- Are the warning messages that are encountered in unusual situations.
  • Error- Are the error messages produced when IDE fails in executing a command.

Reference Pane: shows a precise description of presently chosen command in the Editor along with the locator and value to be used for that command.

UI-Element Pane: Used for advanced Selenium users. JavaScript Object Notation (JSON) is used for defining element mappings.  “UI Element Documentation” option under help menu contains the documentation and resources.

Rollup Pane: Allows executing a set of commands in a go. The set of commands are known as ‘rollup’. Here, extensive usage of JavaScript and UI-Element concepts are employed to formulate a set of commands similar to a ‘function ‘in any programming language.

Rollups are reusable multiple times in the test case.

Learn Basics of Selenium IDE  and also visit @ bigclasses.com

Share on FacebookShare on LinkedInTweet about this on TwitterGoogle+