PDA

View Full Version : Elements Id's of Items in Combox


denizstij
05-07-2008, 01:09 PM
Hi,

We are using Selenium for testing our UI which is developed by ext-gwt(gxt). In selenium, each html elements must have a static id, in order to invoke a specific action on that element in a test case.

We are able to set a static unique id almost all widget in ext-qwt but combox. It seems combobox widget has several subcomponents and items in a combobox is rendered on internal panel (called "list" in combobox class) of which id is set internally. I would like to set id of this panel (and also "view" DataView object's id). But i am not able to do that. As in the attachment, these two elements get "my-41" (container) and "my-42" (view) dynamically.

Please note that, I am able to set the id of combobox (with setID(String) method) but not the id of these items and their internal container (list and view).

Briefly, i need to set element id of "list" (Container) and "view" (DataView) objects (in other words, item's id) as if in "initList" method Combobox class.

initList () {
...
list.setId("list_static_id");
view.setId("view_id");
...
}


Any idea ?

Thanks in advance

Deniz

deanoj
05-12-2008, 05:57 PM
Having never used GXT I can't be certain this will work.

However I had the same problem with ExtJS. You're correct about the combo having child components been the issue. What I did was extend the ComboBox to explicitly set an ID for the 'inner' dropdown....

Original:

this.innerList = this.list.createChild({cls:cls+'-inner'});

Modified:

this.innerList = this.list.createChild({cls:cls+'-inner', id: this.innerId});

Now i can use the 'innerId' config option when defining my customcombo, and selenium works fine.

Hope this helps.

Deano

darrellmeyer
05-12-2008, 07:07 PM
I added "id={id}" to the default template. If your model object has an id, it will be substituted. Change is in SVN.