02-28-2008, 05:43 AM
Hi Deepak,
Thank you so much for your reply. However, still have issue wth this childObjects. Basically , my goal is to find Div within a div. To locate the Div I want to locat, there are multiple layer between. To give you a simply example, it wil be something like :
Browser->frame -> table -> Div ->Table -> Div ->Div
It is the final Div I want to located. However, to make the story compliated, the structure of the final Div isas such :
I have try to insert this code
c)
Now my code is as :
With this I am getting 0 for my num.
If I change
Set allNodes= dataPane.ChildObjects()
I am getting 10. seems like ChildObjects is getting the leave element, In other words, it is counting at the number of SPAN (Notice that inside my DIV , I have SPAN). This is not what I want. I want the Parent Div. Can you suggest a way to get the DIV. also, to add on it, do I need to list out the exact path of the DIV. ( this can be very long). Will I be able to use descript to tell the characters of the elements want, and using a general path such as: browser(1).page(1).frame(1)?
Again, Many thanks to your suggestion.
Carol
Thank you so much for your reply. However, still have issue wth this childObjects. Basically , my goal is to find Div within a div. To locate the Div I want to locat, there are multiple layer between. To give you a simply example, it wil be something like :
Browser->frame -> table -> Div ->Table -> Div ->Div
It is the final Div I want to located. However, to make the story compliated, the structure of the final Div isas such :
Code:
<div id="designerForm:mde1_Accounts_member_node" class="datatab_node_div">
<span id="designerForm:mde1_Accounts_member_minus" >
<img class="metadata_tree_node_img" src="/../minus_xp.gif"/>
</span>
<span clickaction="select">
<img class="metadata_tree_node_img" src="/../measure_parent_member.gif"/>
</span>
</div>
I have try to insert this code
Code:
obj_ChkDesc("Class Name").Value = "WebElement"
I got an General Run Error at executed :
Set allNodes= dataPane.ChildObjects(obj_ChkDes
Now my code is as :
Code:
Dim obj_ChkDesc
Set obj_ChkDesc = Description.Create()
obj_ChkDesc("class").Value = "datatab_node_div"
obj_ChkDesc("html tag").value = "div"
Dim dataPane
Set dataPane= Browser("title:=InfoView").Page("title:=InfoView").Frame("title:=Multi-Dimensional Designer").WebElement("class:=datatab_metadata_div").webElement("html id:=designerForm:mde1_tree")
Dim allNodes
Set allNodes= dataPane.ChildObjects(obj_ChkDesc)
Dim num
num =allNodes.Count()
Msgbox(num)
With this I am getting 0 for my num.
If I change
Set allNodes= dataPane.ChildObjects()
I am getting 10. seems like ChildObjects is getting the leave element, In other words, it is counting at the number of SPAN (Notice that inside my DIV , I have SPAN). This is not what I want. I want the Parent Div. Can you suggest a way to get the DIV. also, to add on it, do I need to list out the exact path of the DIV. ( this can be very long). Will I be able to use descript to tell the characters of the elements want, and using a general path such as: browser(1).page(1).frame(1)?
Again, Many thanks to your suggestion.
Carol