Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Selenium testing - possible additional widget identification?

    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
    Code:
    JSOHelper.setAttribute(jsObj, "mySeleniumDebugId", "myId");
    It only works in things like
    Code:
    scLocator=//Menu[ID="menu_open"]/body/row[mySeleniumDebugId=id]/col[1]
    but what I would like to achieve is:
    Code:
    scLocator=//IButton[mySeleniumDebugId=myId]/
    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
    Code:
    scLocator=//IButton[ID="isc_IButton_9"]/
    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.
    Last edited by narvik; 22 Jun 2011, 03:48.
Working...
X