JavaScud | Forum | JIRA | Blog |
  Dashboard > Selenium 中文 > ... > Selenium IDE - Wiki > Contributed Extensions and Formats
  Selenium 中文 Log In View a printable version of the current page.  
  Contributed Extensions and Formats
Added by Tin Steeler, last edited by Tin Steeler on Nov 07, 2006
Labels: 
(None)

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:

  1. Download the .js file attached in each page
  2. Open Options - Options... in the menu bar, click Formats tab, and click Add
  3. A new dialog opens. Enter arbitrary name into "Name of the format" field.
  4. Open the downloaded .js file with the text editor, copy and paste the code into the text area in the opened dialog.
  5. Click OK in the dialogs.
  6. 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:

  1. Copy the extension code into a new .js file. You can place it anywhere on your disk.
  2. Open Options - Options... in the menu bar.
  3. Choose the saved file in "Selenium IDE extensions" field and click OK.
  4. 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 });
Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators