Skip to content

Instantly share code, notes, and snippets.

@freynaud
Created April 27, 2012 09:24
Show Gist options
  • Save freynaud/2507758 to your computer and use it in GitHub Desktop.
Save freynaud/2507758 to your computer and use it in GitHub Desktop.
function MyUIAElementArray(elements) {
this.elements = elements;
this.length = elements.length;
this.toArray =function(){
return this.elements;
}
this.firstWithName = function(name) {
for( i = 0; i < this.elements.length; i++) {
var current = elements[i];
if(current.name() === name) {
return current;
}
}
throw UIAException("cannot find an element with name=" + name);
}
this.buttons = function() {
return this._getElementsOfType("UIAButton");
}
this.links = function() {
return this._getElementsOfType("UIALink");
}
this.images = function() {
return this._getElementsOfType("UIAImage");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment