1 - Selenium Reference
1 - Selenium Reference
Firefox
Installation of Selenium IDE
What you need
Mozilla Firefox
Active Internet Connection
Selenium IDE Works with all major versions, but we recommend to use 47.0.1 &
above as they have better stability.
Steps 1)
Steps 2)
Wait until Firefox completes the download and then click "Install."
Steps 3)
Wait until the installation is completed. In the pop-up window, click "Restart Now."
Steps 4)
After Firefox has restarted, launch Selenium IDE using either of two ways:
By pressing Ctrl+Alt+S
By clicking on the Firefox menu button> Developer>Selenium IDE
Steps 5)
Step 1
Wait for Firefox to complete downloading this add-on. On the dialog box that comes
after, click "Install Now."
Step 3
Wait for the installation to complete. A notification will pop-up saying, "Firebug has
been installed successfully." You can immediately close this pop-up.
Note: In case if you do not see above pop-up, no worries! This pop-up appears for a
few seconds and disappears.
Step 4
Press F12
Click on the Firebug button in the upper right corner of the Firefox window.
Step 5
Open Firefox
Press Ctrl + Shift + "I"
Note: Advantage of using Firebug over DevTools is that, in FireBug, you can directly
copy the XPath of a WebElement to be used in Selenium. Hence we use it in our
tutorials
Plugins
Selenium IDE can support additional Firefox add-ons or plugins created by
other users. You can visit here for a list of Selenium add-ons available to date.
Install them just as you do with other Firefox add-ons.
These four plugins are required by Selenium IDE to convert Selenese into different
formats.
The Plugins tab shows a list of all your installed add-ons, together with the
version number and name of the creator of each.
User Extensions
Selenium IDE can support user extensions to provide advanced capabilities. User
extensions are in the form of JavaScript files. You install them by specifying their
absolute path in either of these two fields in the Options dialog box.
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:
File menu
As of Selenium IDE v1.9.1, test cases can be exported only to the following
formats:
.cs (C# source code)
.java (Java source code)
.py (Python source code)
.rb (Ruby source code)
Edit Menu
It contains usual options like Undo, Redo, Cut, Copy, Paste, Delete, and
Select All.
The two most important options are the "Insert New Command" and "Insert
New Comment".
Options menu
It provides the interface for configuring various settings of Selenium IDE.
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.
Default Timeout Value. This refers to the time that Selenium has to wait for a
certain element to appear or become accessible before it generates an
error. Default timeout value is 30000ms.
Selenium IDE extensions. This is where you specify the extensions you
want to use to extend Selenium IDE's capabilities. You can
visit http://addons.mozilla.org/en-US/firefox/and use "Selenium" as a keyword
to search for the specific extensions.
Remember base URL. Keep this checked if you want Selenium IDE to
remember the Base URL every time you launch it. If you uncheck this,
Selenium IDE will always launch with a blank value for the Base URL.
Autostart record. If you check this, Selenium IDE will immediately record
your browser actions upon startup.
Locator builders. This is where you specify the order by which locators are
generated while recording. Locators are ways to tell Selenium IDE which
UI element should a Selenese command act upon. In the setup below,
when you click on an element with an ID attribute, that element's ID will be
used as the locator since "id" is the first one in the list. If that element does
not have an ID attribute, Selenium will next look for the "name" attribute since
it is second in the list. The list goes on and on until an appropriate one is
found.
Table View
Most of the time, you will work on Selenium IDE using the Table View.
This is where you create and modify Selenese commands.
After playback, each step is color-coded.
To create steps, type the name of the command in the "Command" text box.
It displays a dropdown list of commands that match with the entry that you
are currently typing.
Target is any parameter (like username, password) for a command and Value
is the input value (like tom, 123pass) for those Targets.
Source View
It displays the steps in HTML (default) format.
It also allows you to edit your script just like in the Table View.
Log Pane
The Log Pane displays runtime messages during execution. It provides real-time
updates as to what Selenium IDE is doing.
Debug - By default, Debug messages are not displayed in the log panel. They
show up only when you filter them. They provide technical information about
what Selenium IDE is doing behind the scenes. It may display messages such
as a specific module has done loading, a certain function is called, or an
external JavaScript file was loaded as an extension.
Info - It says which command Selenium IDE is currently executing.
Warn - These are warning messages that are encountered in special
situations.
Error - These are error messages generated when Selenium IDE fails to
execute a command, or if a condition specified by "verify" or "assert"
command is not met.
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.
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.
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.
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.
An example of how the contents of the rollup tab look like is shown below.
Summary
Selenium IDE (Integrated Development Environment) is the simplest tool in
the Selenium Suite.
It must only be used as a prototyping tool.
Knowledge of JavaScript and HTML is required for intermediate
topics such as executing the "runScript" and "rollup" commands.A rollup is a
collection of commands that you can reuse to shorten your test scripts
significantly.Locators are identifiers that tell Selenium IDE how to access an
element.
Firebug (or any similar add-on) is used to obtain locator values.
The menu bar is used in creating, modifying, and exporting test cases into
formats useable by Selenium RC and WebDriver.
The default format for Selenese commands is HTML.
The "Options" menu provides access to various configurations for
Selenium IDE.
The Base URL is useful in accessing relative URLs.
The Test Case Pane shows the list of currently opened test cases and a
concise summary of test runs.
The Editor provides the interface for your test scripts.
The Table View shows your script in tabular format with "Command",
"Target", and "Value" as the columns.
The Source View shows your script in HTML format.
The Log and Reference tabs give feedback and other useful information
when executing tests.
The UI-Element and Rollup tabs are for advanced Selenium IDE users
only. They both require considerable effort in coding JavaScript.
UI-Element allows you to conveniently map UI elements using JavaScript
Object Notation (JSON).