When producing HTML markup from XForms, Orbeon Forms automatically generates ids if your XForms doesn't contain ids. If you reload the same page twice, the ids produced by Orbeon Forms will be the same. However, if you upgrade to a newer version of Orbeon Forms, those ids could be different, which might be an issue for you if you have automated tests that depend on those ids. You can avoid this issue by making sure you always specify ids in your XForms, and this bookmarklet helps you to check that a given page doesn't contain any automatically generated id.
- Drag & drop the following link to your bookmark toolbar: Check ids.
- Right click on the bookmark you created, choose Properties, in the Location field, remove
http://remove?this=
at the beginning of the location.
- Load the page you want to check.
- Make sure the Firebug console is open.
- Click on the bookmarklet you added to your bookmark toolbar. An array with the elements using an automatically generated id is shown in the console.
You'll find the code for this bookmarklet in the bookmarklet-code.coffee
(see below). We can't compile the
CoffeeScript to JavaScript running the CoffeeScript compiler on the browser as browsers limit cross-script
scripting. So you need to compile the CoffeeScript on your machine "by hand", that is with: coffee -c bookmarklet-code.coffee
.
The source for the bookmarklet is in bookmarklet-link.js
(see below). This loads and runs the latest version of
bookmarklet-code.js
, so you won't have to change the bookmarklet in your browser even if you change its implementation
in CoffeeScript.