Skip to content

Extensions: Provide a means for extensions to add and implement new Locator types #104

Open
@jeremybramwell

Description

@jeremybramwell

I'm not very familiar with the exact restrictions imposed by the browsers and the current plans for how extensions that add/modify selenium IDE functionality are going to work. So my thoughts below make a lot of likely incorrect assumptions.

Goal: Allow "Add on" WebExtensions to add new Locators to the list of locators that selenium IDE uses to convert an element to an "address" when recording and from an address to an element during playback.

Requirements:

  • Provide a means for a separate WebExtention (Add-on Extension) to register additional Locators (LocatorStrategies) with Selenium IDE.
    • This might be accomplished by accepting something like an "AddLocator" message type that the add-on can send to selenium IDE.
    • If there is a more general mechanism for an add-on to register itself with selenium IDE then a list of the locators the add-on provides might be included in that registration.
    • Registration should allow for multiple Locators to be added by an add-on.
    • Registration might also allow for a display name and description to be provided for each Locator added so that it can be displayed in the locator ordering list and in the dropdown selector when editing a recorded step.
  • Allow users to change the order of added Locators along with the built-in Locators.
  • Allow users to enable/disable Locators (both built-in and add-on).
  • Deal with the case where an add-on Extension that adds Locators is removed or disabled.
  • During recording Selenium IDE would send a message to the add-on with the id of the Locator to resolve and the element to generate an "address" for. The recorder would then wait for all locators to be resolved. A timeout, which might be configurable, would limit how long Selenium IDE would wait for add-on locators to be resolved.
  • During playback Selenium IDE would send a message to the add-on with the id of the Locator to resolve and the "address" to resolve into an element in the current DOM. Selenium IDE would then wait for a reply message from the add-on which would contain the resolved element.

Use Case:
Our company has a very complex single page application and would like to use Selenium IDE to allow our non-programmer testers to generate test scripts. Our application generates unique element ids and classes per session which prevents any locators using those attributes to generate scripts that can be replayed. Other locators like xpath are prone to break when the application is enhanced or dictionaries that our customers use to customize the application are modified. So we have built custom logical identifiers into the DOM elements that allow for robust addressing of important logical elements. We implemented this capability in the prior version of Selenium IDE with a corresponding plugin for selenium (not the IDE) for consuming scripts which use this specialized locator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions