1.1. Selenium IDE with Firefox - Install and Intro

Here's a quick guide on how to get started with Selenium IDE

Installation

  • Get Selenium IDE from here

  • Install Selenium IDE as plugin in Firefox

  • Restart Firefox

  • Start Selenium IDE: under Tools there's now a new entry called Selenium IDE: opens a new window

As a result you should get an empty Selenium IDE window. Notice that there is a list of test cases (with one entry 'Untitled') in this case) to the left of the table. You can make it appear by moving the resize indicator in the left.

Here's what it should look like

An empty Selenium IDE

Configure the Olat Map file

We'll go into details about how the Olat Map file works later. Here's how to configure it in Selenium IDE

  • Go to Options>Options...

    Setting for the Olat Map file in Selenium IDE

  • Configure the user-extensions.js file with one of the following paths:

    • Copy the nightly generated user-extensions.js from http://nightly.olat.uzh.ch/nightly/raw/doc/user-extensions.js to a local file and configure that local file. Make sure to repeat this often to catch changes in the olat-ui-map!!!

    • if you're doing modifications on the map file (see later), build it yourself and configure it, e.g.: C:\eclipse\workspace\seleniumtests\build\classes\user-extensions.js

  • Enable 'Remmber base URL'

  • Enable 'Record assertTitle automatically'

  • Enable 'Record absolute URL'

  • Enable 'Enable UI-Element' (important!)

  • Restart Selenium IDE (not the whole browser, just Selenium IDE. Activates the UI-Elements)

Recording the first test case

This section walks through recording the first test case with Selenium IDE

  • Make sure the Record button in the right end of the toolbar is switched on

  • Open https://nightly.olat.unizh.ch/nightly/dmz/

  • Enter 'administrator' and the corresponding password and click 'Login'

  • This should result in something like this:

    The first test case in Selenium IDE

  • To rerun the test, click on one of the green Play buttons

A few things Gotchas here

  • Currently, Selenium IDE sometimes has refresh problems and you don't see the recorded steps until you move the mouse into the command table

  • Selenium sometimes has troubles catching keyboard input when Firefox does form-autocompletion.

  • Sometimes Selenium records 'click' instead of 'clickAndWait' and rerunning fails because of this.

  • Selenium-Recording is not always 100% automated - in fact there is quite a bit of manual effort involved and you can do it all manually in Selenium IDE as well. For example: you can easily type 'clickAndWait' in the command field and enter the target link in the target field yourself - instead of relying on the record mechanism

  • You can set Breakpoints in Selenium IDE by right clicking on any line and selecting 'Toggle Breakpoint' [B]

  • You can run single Selenium commands by double-clicking on a line

  • Given that you are on the right page, you can let Selenium visualize a UI-Element by clicking on the 'Find' button. It will let the element blink green for a while

Make sure to play with the basics of Selenium such as Running a test, Breakpointing, Stepping, Finding a UI-Element before going forward