7d. Selenium IDE – Know your IDE features

This entry is part 11 of 36 in the series Selenium

Welcome back to Magic Meadows! Today we will be diving in to know more about the features of the Selenium IDE that we installed with the help of my previous post, “Breaking the Surface: A First Look”.

For reference, I am going to paste the first look image that we saw some time back,
First look at Selenium IDE

Menu Bar

The menu bar has five components viz., File, Edit, Actions, Options and Help. Let us concentrate on the ones that we will be using frequently.

a. File Menu

  • File menu is used to create, open, save, export, close test cases and test suites.
  • Recently worked test case/test suite files can also be viewed.
  • Tests get saved in HTML format by default.
  • The best options here that come handy for us are, “Export Test Case As…” and “Export Test Suite As…” because these allow us to convert the automated test cases of Selenium IDE into a format combination (programming language/unit testing framework/Selenium framework) that can be utilized directly in Selenium Remote Control or WebDriver. We will cover more about this as we proceed.

Below is a snapshot of the File menu with the “Export Test Case As…” option expanded.
File Menu
As you can see, with Selenium IDE version 2.9.0, we can export the currently opened test case in Ruby, Python 2, C# and Java languages to be used along with their corresponding unit testing frameworks.

b. Edit Menu

  • Edit menu allows us to Undo, Redo, Cut, Copy, Paste, Delete and Select All commands.
  • The options worth remembering from this menu are “Insert New Command” and “Insert New Comment”.
  • “Insert New Command” will allow the user to insert a new command on top of the currently selected command.
  • “Insert New Comment” will allow the user to add a new comment on top of the currently selected line. This is very useful for documentation purpose.

Here is the Edit menu for you,
Edit Menu
It’s time for another BrainBellRelating! Using things we already know to relate what we are learning helps brain to remember with more ease. It is just like sticking notes to your brain.

So here goes our well known poem but with slight modification,

Roses are red
Violets are blue
(In Selenium IDE)
Commands are Black &
Comments are Purple!

Commands and Comments

If you think that you can do it better then go ahead and give it a try. You are always welcome to post your ideas and thoughts in the comments section.

c. Actions Menu

Starting with a snapshot of the menu for better understanding and visualization,
Actions Menu

  • Actions menu allows us to perform few actions while working with our test cases such as recording browser actions, playing selected test case/test suites etc.
  • Toggle Breakpoint” is used in debugging by setting one or more breakpoints at any execution step in the test case. This helps in breaking the execution forcefully.
  • Set / Clear Start Point” is used to set or clear the start points at any test step. Thus allowing us to execute from the set start point.
  • A particular command can be selected and executed using “Execute this command”.

d. Options Menu
Options Menu

  • Options menu is one of the most important menus used as this allows us to configure the various pre-defined settings of Selenium IDE tool.

Let us see one by one. Firstly clicking on the “Options…” will open the ‘Selenium IDE Options’ dialog box which looks like this,
Options Tab
In the General tab:

  • Default Timeout Value – This represents the time in milliseconds that the Selenium IDE would prefer to wait for a test step execution before generating an error. The default value is set to 30000ms i.e. 30s. This value can be increased or decreased appropriately based on the speed at which the web element would appear or become accessible.
  • Extensions – Selenium IDE extensions enhance the tool’s capabilities and this can be achieved by downloading the required extensions from http://addons.mozilla.org/en-US/firefox/ link using “Selenium” as a keyword in the search box at the top right corner of the page. These will be the additional extensions apart from the ones defined as part of the baseline IDE extensions.
  • Remember base URL – Checking this option would make sure that Selenium IDE remembers or loads the URL in the base URL text box of the tool every single time it is launched. Upon unchecking this option, IDE will launch with a blank value in the base URL bar.
  • Enable experimental features – Checking this field for the first time with an active internet connection would import the available formats which we will see in a bit.

Formats tab:
This tab shows the available formats in Selenium IDE along with a sample of the chosen format structure.  User can add/rename/delete any of the available formats with great ease.
Plugins tab shows the default ones that are available with the tool. Numerous plugins are available which can be downloaded and installed easily. A couple of such examples are,

  1. ‘Selenium IDE: PHP Formatters’ – Used to convert the HTML test cases into PHP format
  2. ‘File Logging’ – To save the generated log to a file

Locator Builders tab,
Locators are a way for Selenium to uniquely locate or identify a web element on the web page. For example, while recording a test case, if we click on a web element, Selenium will immediately look for its ‘ui’ attribute to store its location since that is mentioned first on the list. If ‘ui’ is not available, it will look for ‘id’ as that comes second in the list. This goes on until a unique locator is found for the clicked element. Hence this list if a method of prioritizing the order in which the locators are to be generated while recoding. A simple drag and drop in the left pane will change the order as desired.

Secondly, we have the “Format” in the Options menu:

Format option shows the available formats to which a Selenium IDE test case can be converted. HTML is the default format chosen. Format gives a combination of the programming language to which the chosen test case will be converted/unit testing framework/the tool in the suite with which the code can be used.

The third and one of the important options is “Clipboard Format”. Refer to the image below,
This looks very similar to the Format option that we just saw. Clipboard format helps us to choose the format in which we would like the code snippet to appear upon pasting, on copying a command from the test script pane. HTML is the default selection here as well.

e. Help Menu
Help Menu
Help is always available with Selenium as it has a wide community and user base. This option allows us to report an issue, search for issues, look thorough the available documentation, check on release notes, official blog and website; thus providing a heap of information.

Base URL Bar

Base URL bar
It is a dropdown list remembering all previously accessed URLs for easy access. It is similar to the URL in the address bar that we see in our web page.
Base URL
An ‘open’ command with blank target will navigate to the URL specified in the Base URL bar.

Whereas, if ‘open’ command is used with a target such as ‘/download/’ as in our image above, Selenium IDE will take us to http://www.seleniumhq.org/download/ page. Thus the target is appended to the specified base URL. Hence this is highly useful in case of relative URLs.

With an intention of not making this post too long, let us take a break and once you are back, click on the next post, “Continue with Know your Selenium IDE features”.

See you again. Have a great day folks!

Series Navigation<< 7c. Selenium IDE – Breaking the Surface: A First Look7e. Selenium IDE – Know your IDE features Contd. >>

Leave A Comment

Your email address will not be published. Required fields are marked *