Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with getting the number of children
#3
Not Solved
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 :
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
c)

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
Reply


Messages In This Thread
RE: problem with getting the number of children - by Carol - 02-28-2008, 05:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Number generator and verification problem jinnah 4 10,486 09-28-2012, 04:03 AM
Last Post: jinnah
  Count the number of 3 number appers between 0-3333 SaranKumarV 1 3,884 09-20-2010, 06:32 PM
Last Post: rdemers25

Forum Jump:


Users browsing this thread: 3 Guest(s)