SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetSubItemCount() doesn\'t work correctly???

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by John Green:
    Expand the tree fully and ListPrint what wTree.GetContents () gives you.

    Post that here.
    <HR></BLOCKQUOTE>

    that's exactly what i did. i made sure that the tree is expanded and did a getsubitems() and it just returned "C". getcontents did return all the items in the tree.

    now, i realized something. i think silktest only gets the next subitem on the list but not all the children underneath it. is there any way i can do a count of all the child objects in a subtree?



    ------------------

  2. #2
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetSubItemCount() doesn\'t work correctly???

    please note in the sample i gave above, it should be something like this. i don't know why it placed both c and d under b in my post.

    [-] a
    [-] b
    [-] c
    [-] d


    ------------------

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetSubItemCount() doesn\'t work correctly???

    Maybe you're just printing the first item returned. Post your code so we can see what's happening.

    Try recording expanding and collapsing the item, so you make sure you get a right item reference.

  4. #4
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetSubItemCount() doesn\'t work correctly???

    [-] testcase test2 ()
    [ ] string sObject = "Object1"
    [ ] ExpandAllTreeView()
    [ ] App1.SetActive()
    [ ]
    [ ] list of string sChildren = App1.TreeView1.GetSubItems(sObject)
    [ ] print (sChildren)
    [ ]
    [ ] string sChildCount = str(App1.TreeView1.GetSubItemCount (sObject))
    [ ] print (sChildCount)

    ___

    I also tried what you suggested to record expanding and collapsing and it's the same thing.




    ------------------

  5. #5
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetSubItemCount() doesn\'t work correctly???

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by mbt011:
    [-] testcase test2 ()
    [ ] string sObject = "Object1"
    [ ] ExpandAllTreeView()
    [ ] App1.SetActive()
    [ ]
    [ ] list of string sChildren = App1.TreeView1.GetSubItems(sObject)
    [ ] print (sChildren)
    [ ]
    [ ] string sChildCount = str(App1.TreeView1.GetSubItemCount (sObject))
    [ ] print (sChildCount)

    ___

    I also tried what you suggested to record expanding and collapsing and it's the same thing.


    <HR></BLOCKQUOTE>


    "Object1" doesn't seem like a treeview item. I would expect a reference such as
    "/Project/Subject/Item".


  6. #6
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetSubItemCount() doesn\'t work correctly???

    either way, typing in the full path or entering the object itself gives me the same results. i don't know if it's a new feature in the latest silktest but now, i can access items in a treeview without having to type in the full path. all i just have to pass is the object name.

    ------------------

  7. #7
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GetSubItemCount() doesn\'t work correctly???

    A
    |_
    B
    |_C
    |_D

    Let's say I have a tree and I am trying to get the no. of items under B by doing

    integer iCount = Window1.TreeView1.GetSubItemCount (sB)

    print (iCount)

    what's returned is 1? what i am expecting is 2?

    is there a known problem with this function? does anybody know a workaround? thanks.

    ------------------


    [This message has been edited by mbt011 (edited 06-18-2002).]

    [This message has been edited by mbt011 (edited 06-18-2002).]

  8. #8
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GetSubItemCount() doesn\'t work correctly???

    Expand the tree fully and ListPrint what wTree.GetContents () gives you.

    Post that here.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:52 AM.

Copyright BetaSoft Inc.