Forum Discussion

jlesch's avatar
jlesch
New Contributor
13 years ago

Read a specific panel from web object

Hi,



I am wanting to know if its possible to read a specific panel from a web object.

For Example



I have have a object say



Sys.Browser("firefox").Page("http://www.test.com/").Panel("HN_HNMC").Panel("HN_HNMC_Cont").Panel(4).Panel(0).Panel(0).Panel(1).Panel(0).Panel(1).Panel(1).Link(0)



and I want to "Read" the value 4 in Panel(4). 



My goal with this is to have logic that can change that panel number dynamically with a variable.



Any thoughts on this?



Thanks
  • Hi Josh,



    One approach could be that:



    First, Retrieve this object: "Sys.Browser("firefox").Page("http://www.test.com/").Panel("HN_HNMC").Panel("HN_HNMC_Cont")" and store it in a variable. Now, you only have to access its children in a loop.



    Other way to do that is to add an attribute (such as a classname) to all the panels you need, use any of the Test Complete Find methods (such as FindAll) to get them, and then loop it.



    Hope it helped!