Selecting from drop-down list of Select Button

I have a toolbar with several Select Buttons, and I need to create automation tests for them. Now the problem is I can’t make selections from drop-down lists of these Select Buttons via execution of javascript. Could you please explain how to call them, using this demo: dhtmlx.com/docs/products/dht … vents.html - ie I need to make appear drop-down list of Print button and then select some Settings element from the list.

Do you mean IDs? Or you want to call event (i.e. ‘onClick’) programmatically?

Yes, I want to call event “onClick” programmatically, but toolbar.callEvent(‘onClick’, [‘print’]) doesn’t make the drop-down list to appear.

Hi

The following code will extend toolbar’s functionality (unclude it on page after toolbar.js):

[code]
dhtmlXToolbarObject.prototype.openSelectMenu = function(id) {
this.callMyEvent(this.objPull[this.idPrefix+id].arw, “mouseover”);
this.callMyEvent(this.objPull[this.idPrefix+id].arw, “mousedown”);
};

dhtmlXToolbarObject.prototype.callMyEvent = function(obj, name) {
if (document.createEvent) {
var e = document.createEvent(“MouseEvents”);
e.initEvent(name, true, false);
obj.dispatchEvent(e);
} else if (document.createEventObject) {
var e = document.createEventObject();
e.button = 1;
obj.fireEvent(“on”+name, e);
}
};[/code]

To open select’s menu call:

toolbar.openSelectMenu(id);

Hope this will help