This page is a repository for user-contributed custom formats and extensions. If you have written a useful format code that can be shared, add it to this page.
For writing custom formats and extensions, see Adding Custom Format and Writing Extensions.
Formats
To add these formats:
- Download the .js file attached in each page
- Open Options - Options... in the menu bar, click Formats tab, and click Add
- A new dialog opens. Enter arbitrary name into "Name of the format" field.
- Open the downloaded .js file with the text editor, copy and paste the code into the text area in the opened dialog.
- Click OK in the dialogs.
- The new format will appear under Options - Formats in the menu bar.
Selenium on Rails
A Wiki-like format that can be used in Selenium on Rails
. [more...]
Java driven Selenium
Can be used to generate or modify JUnit tests for Java driven Selenium. [more...]
Extensions
To use the extensions:
- Copy the extension code into a new .js file. You can place it anywhere on your disk.
- Open Options - Options... in the menu bar.
- Choose the saved file in "Selenium IDE extensions" field and click OK.
- Restart Selenium IDE by closing the window and opening it again.
Recording every clicks on page
By default, Selenium IDE only records click events on certain types of elements (e.g. <a>, <input type="button">, ...).
You can record any click events occured in a page by putting the following code as Selenium IDE extension.
Recorder.removeEventHandler('clickLocator');
Recorder.addEventHandler('clickLocator', 'click', function(event) {
if (event.button == 0) {
this.clickLocator = this.findLocator(event.target);
}
}, { capture: true });
Recording clicked coordinates
This extension records "clickAt" commands instead of "click" commands.
Recorder.removeEventHandler('click');
Recorder.addEventHandler('clickAt', 'click', function(event) {
var x = event.clientX - editor.seleniumAPI.Selenium.prototype.getElementPositionLeft(event.target);
var y = event.clientY - editor.seleniumAPI.Selenium.prototype.getElementPositionTop(event.target);
this.record('clickAt', this.findLocator(event.target), x + ',' + y);
}, { capture: true });