If you’re trying to automate tests of your SproutCore application with Selenium, for example, you’ll realise that the HTML element ids are automatically generated. They change every now and then and break all your tests.
To get rid of this problem, you can override the
layerIdmethod of certain view classes to generate a stable, and human readable, id.
The following code takes the view hierarchy, and generates an id based on the parents’ names. For example, the
mainPage.mainView.someOtherView.theTargetViewview will be given the