I am creating selenium tests for our application. From what I've read the best way is to make sure that every widget has its own unique ID. Unfortunately this solution would be too complex in our case. Is it be possible to add other custom information to the widgets that would be "almost" unique?
My first thought was to get get a JavaScriptObject and use
It only works in things like
but what I would like to achieve is:
In this case our tests would continue to work even if someone added a new button, unless it was a button of id "myId". Anyone has an idea how to do it?
EDIT just to further clarify:
the problem is that
contains redundant information that it is an IButton. It would be great if we could change the base of the generated id ("isc_IButton_") to something else without subclassing IButton.
My first thought was to get get a JavaScriptObject and use
Code:
JSOHelper.setAttribute(jsObj, "mySeleniumDebugId", "myId");
Code:
scLocator=//Menu[ID="menu_open"]/body/row[mySeleniumDebugId=id]/col[1]
Code:
scLocator=//IButton[mySeleniumDebugId=myId]/
EDIT just to further clarify:
the problem is that
Code:
scLocator=//IButton[ID="isc_IButton_9"]/