I have found one solution so far, so I decided to share it better for review / improvement.
Selenium allows you to extend your behavior using the user-extensions.js file .
For example, this creates a new insertHtml command in Selenium:
Selenium.prototype.doInsertHtml = function(locator, text){ var element = this.page().findElement(locator); var innerHTML = text + element.innerHTML; element.innerHTML = innerHTML; }
To use the Selenium IDE, you simply include the extension file through the options menu of the IDE itself. The next time you run the IDE, it will automatically have new available commands (from the user extension file).
As the page address of the document changed and was reused, I copied the corresponding part below:
Selenium expansion
It can be quite simple to extend Selenium by adding your own actions, statements and locator strategies. This is done using javascript by adding methods to the prototype of the Selenium object and the prototype of the PageBot object. When launched, Selenium will automatically look at the methods on these prototypes, using name patterns to recognize which ones are actions, statements, and locators.
The following examples provide guidance on how Selenium can be expanded using javascript.
Actions
All doFoo methods on the Selenium prototype are added as actions. For each foo action, there is also the fooAndWait action registered. An action method can take up to 2 parameters, which will be passed in the second and third column values ββin the test.
Example: add the action "typeRepeated" in Selenium, which twice enters the text in the text box.
Selenium.prototype.doTypeRepeated = function(locator, text) {
source share