Forum Discussion

aduddella's avatar
aduddella
Contributor
16 years ago

How to get a Parent object when i have a child object using VB script

Hi



I am trying to write a code which will search through the web page with the help of page object(which I have name mapped).Once I find the object which has innertext="abc" then I would have also to find the multiple occurences of these innertext and know their parents so that i can then know which of these objects have the same parent so that they would become sibblings and then compare their inner text.



I need this code in VB script in a urgent way Any help would be appreciated





I have the following situation where I have to compare the values of two table cells data to check whether they are equal or not



TABLE Structure 



                COLUMN_1   COLUMN_2



  ROW 1       ABC                      ABC



  ROW 2       DEF                         XYZ





I would want to compare the values in the cells in this tables which are there in the webpage to make sure they are equal



Thanks in Advance



    










1 Reply


  • Hi Anand,







    Once I find the object which has innertext="abc" then I would have also to find the multiple occurences of these innertext



    You can use the FindAllChildren method to retrieve all objects which match a specific criteria regardless of their location in the objects hierarchy (see the "FindAllChildren Method" help topic (http://www.automatedqa.com/support/viewarticle/12741/) for more information).







    know their parents



    You can use the Parent property for that. Please see the "Parent Property" help topic (http://www.automatedqa.com/support/viewarticle/13203/) for more information.







    I have the following situation where I have to compare the values of two table cells data to check whether they are equal or not 



    You can use the approach described in the "Parsing HTML Tables" (http://www.automatedqa.com/support/viewarticle/12719/) help topic to work with the table and retrieve the needed data.