if it helps, here is the exact HTML for my UI:

<div class="comments" id="comments-1538414">
<div class="module">
  <div class="content">
    <div class="body">
      <a name="comments"></a>
              <fieldset>
          <div class="input textarea">
          <textarea title="Add your comment (no HTML please)" 
onfocus="if($(this).attr('value') == 'Add your comment (no HTML please)') 
$(this).attr('value', '');" rows="3" name="myData[comment]" 
id="myData[comment]">Add your comment (no HTML please)</textarea>
        </div>
        </fieldset>
        <div id="inputCount" class="input">
          Characters remaining: 2000
        </div>
        <div class="input">
          <div class="button submit">
            <input type="submit" 
onclick="$(this).modulePerformAction('Comment',{logEvent:{'action':'comment'}});$(this).attr('disabled','true');"
 value="Post comment" id="submitComment">
          </div>
        </div>
                  <div class="title comment">
        <h3>Comments (<span class="count">2</span>)</h3>
      </div>
                  <ul>
                <li id="182725" class="comment">
                                <div class="member">
              <div class="avatar">
                
                                    
                              </div>
            </div>
                    <div class="txt">
          
                     <div class="tools"> 
           <ul> 
                      <li class="admin delete"><a 
onclick="promptDelete('182725','comment', true);return false;" 
href="#">Delete</a></li>
                     </ul>
           </div>
                                   <div class="author">
                <a href="/member/i/52485/">root</a> says:            </div>
                                    <div class="date">
              (1 day ago)
            </div>
                                    <div class="description">
              <p>
                                hello world
                            </p>
            </div>
                      </div>
        </li>
                <li id="182721" class="comment">
                                <div class="member">
              <div class="avatar">
                
                                    
                              </div>
            </div>
                    <div class="txt">
          
                     <div class="tools"> 
           <ul> 
                      <li class="admin delete"><a 
onclick="promptDelete('182721','comment', true);return false;" 
href="#">Delete</a></li>
                     </ul>
           </div>
                                   <div class="author">
                <a href="/member/i/52485/">root</a> says:            </div>
                                    <div class="date">
              (1 day ago)
            </div>
                                    <div class="description">
              <p>
                                www.yahoo.com
www.google.com
www.youtube.com
                            </p>
            </div>
                      </div>
        </li>
              </ul>
          </div>
    <div class="foot">
            <div class="nav_page">
        
      </div>
                </div>
  </div>
</div>
<div style="display: none;" id="alertDeleteConfirm" class="modalWindow">
  <div class="top"><a onclick="cancelDelete();return false;" href="#" 
class="closeModal">Close</a></div>
  <div class="main">
    <div class="module">
      <div class="content">
        <div class="head">
          <h3>Delete Comment Confirmation</h3>
        </div>
        <div class="body">
          <p>Are you sure you want to delete this comment?</p><br><br>
          <div class="actions">
            <div class="button cancel">
              <button onclick="cancelDelete()">Cancel</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

</div>


and, here is how i defined it:

        ui.Container(uid: "comments", clocator: [tag: "div", class: 
"comments"]) {
            TextBox(uid: "title", clocator: [tag: "div", class: "title 
comment"])
            InputBox(uid: "input_textarea", clocator: [tag: "textarea", name: 
"myData[comment]"], respond: ["focus"])
            TextBox(uid: "input_count", clocator: [class: "input", id: 
"inputCount"])
            SubmitButton(uid: "post_comment", clocator: [tag: "input", type: 
"submit", id: "submitComment", value: "Post comment"], respond: ["click"])
            
            List(uid: "comments_list", clocator: [tag: "ul"], separator: "li") {
                Container(uid: "{all}", clocator: [:]) {
                    Container(uid: "member", clocator: [class: "member", tag: 
"div"]) {
                        UrlLink(uid: "link", clocator: [tag: "a"])
                        Image(uid: "image", clocator: [tag: "img"])
                    }
                    Container(uid: "txt", clocator: [class: "txt", tag: "div"]) 
{
                        Container(uid: "tools", clocator: [tag: "div", class: 
"tools"]) {
                            UrlLink(uid: "delete", clocator: [tag: "a", text: 
"Delete"], respond: ["click"])                            
                        }
                        Container(uid: "author", clocator: [tag: "div", class: 
"author"]) {
                            UrlLink(uid: "link", clocator: [tag: "a"])
                        }
                        Container(uid: "date", clocator: [class: "date", tag: 
"div"])
                        List(uid: "description", clocator: [tag: "div", class: 
"description"]) {
                            UrlLink(uid: "{all}", clocator: [:])
                        }
                    }
                }
            }




________________________________
From: Jian Fang <[email protected]>
To: tellurium-users <[email protected]>
Sent: Wed, May 19, 2010 1:01:10 PM
Subject: Re: getting the size of {all} when not defined within a list, and  
getHTMLSource




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.



      

-- 
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.

Reply via email to