SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Nov 2006
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Get child objects nested within multiple tables

    A colleague of mine has a problem but I have no solution for it. Has anyone created a function that given an object will get only the direct children objects? The script below is close but it returns all children objects versus just the direct children. (So if you had a table with 2 tables nested and each of those 2 had 3 tables, I want just the 2 tables nested under the first table, but the script below gives you all 8 tables). Does the code need modifying in the 'childobjects' statement or maybe in the 'get.roproperty' statement. thanks in advance.


    Dim objDescription, objects, numTables, obj
    Set objDescription = Description.Create()
    objDescription("micclass").value ="WebElement"
    objDescription("html tag").Value = "DIV"

    Set objects= Browser("0702136243, LSEIGhidd,").Page("0702136243, LSEIGhidd,").Frame("left").WebTable("Loan 0702136243").ChildObjects(objDescription)

    numTables = objects.Count
    msgbox "Num of children tables " &numTables

    For i = 0 to 10
    msgbox objects(i).GetROProperty("outerhtml")
    Next

  2. #2
    Senior Member
    Join Date
    Jun 2007
    Location
    Toronto, Canada
    Posts
    362
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Get child objects nested within multiple table

    If its multiple tables one inside the other i.e. nested then the child tables should have been inside one of the cells of the parent which is generally the case. Check if its the same for you..If it is then use Childitem instead of Childobjects and see if it helps

  3. #3
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Get child objects nested within multiple tables

    Why don't you directly retrieve 2 different collections from both tables instead? You can then combine the 2 collections into an array or a dictionary..
    Regards,

    Anshoo Arora
    Relevant Codes

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 04:46 PM.

Copyright BetaSoft Inc.