On Wed, May 19, 2010 at 3:55 PM, Jian Fang <[email protected]> wrote:
> BTW, if you have a separator attribute defined for the List, the separator > tags must be the immediate children > of the List object and the list size is determined by the number of > separator tags. > > > On Wed, May 19, 2010 at 3:44 PM, Jian Fang <[email protected]>wrote: > >> 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"); >> >> But we still need to look into the JSON format issue for the new Engine. >> >> Thanks, >> >> Jian >> >> >> On Wed, May 19, 2010 at 2:29 PM, Jian Fang <[email protected]>wrote: >> >>> Thanks a lot. >>> >>> Yes, the JavaScript error stack is there, but it does not print out the >>> root cause. I need your further >>> help if you have time. Please do the following steps: >>> >>> 1) Put a breakpoint before the line that broke the test >>> 2) Put a breakpoint in your @AfterClass method so that the browser will >>> not close after the error is thrown >>> 3) Debug the test >>> 4) Once the first breakpoint is hit, go to the web browser to turn on the >>> firebug console if you use Firefox, or use >>> firebug lite if you use other browsers >>> 5) Resume the test and it should stop at the second breakpoint >>> 6) Look at the firebug console and to see if you can see the line that >>> throws error, usually the JavaScript object >>> in the console is clickable. Click on the error object and it should lead >>> you to the Firebug error stack trace, which >>> should include the root cause. >>> 7) Please post the Firebug console log, especially the Firebug error >>> stack trace. >>> >>> I guess the problem is caused by the JSON format. Need to confirm that >>> from the firebug console log. >>> >>> Thanks in advance, >>> >>> Jian >> >> -- You received this message because you are subscribed to the Google Groups "tellurium-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en.
