Closed GoogleCodeExporter closed 8 years ago
I looked at the getListSize method in tellurium extension:
Selenium.prototype.getListSize = function(locator, separators) {
var $e = teJQuery(this.browserbot.findElement(locator));
if ($e == null || $e.length < 1)
Assert.fail("Cannot find Element for " + locator);
var list = $e.children(separators);
return list.length;
};
The reason you got back zero list size is that the List object with Selenium
APIs has
to be the immediate
parent of the List elements, which is constrained by the jQuery children
selector. We
cannot use "find" because
you may have the same tag at different dom levels, which will lead to incorrect
list
size. But the new Engine does
not have such a limitation because it does group locating.
To solve your problem without new Engine, you can define the ui module as
follows
ui.Container(uid: "description", clocator: [tag: "div", class: "description"]) {
List(uid: "p", clocator: [tag: "p"]){
UrlLink(uid: "{all}", clocator: [:])
}
}
Then, the following command should get back the list size correctly
getListSize("description.p");
Original comment by John.Jian.Fang@gmail.com
on 19 May 2010 at 7:52
Original issue reported on code.google.com by
John.Jian.Fang@gmail.com
on 19 May 2010 at 2:02