How to determine on-screen object hierarchy structure? [message #32535] |
Fri, 17 April 2009 02:31  |
Eclipse User |
|
|
|
Is there a good way (other than guessing) to get the structure of what
objects are on the screen? Especially when objects are nested inside
objects, in order to recognize these objects properly, I need to be
reference them in the appropriate order. (Like a tree of checkboxes inside
a canvass inside a dialogue -- stuff like that).
Any recommendations on this topic greatly appreciated!
-- Steve
|
|
|
|
Re: How to determine on-screen object hierarchy structure? [message #32605 is a reply to message #32571] |
Fri, 17 April 2009 04:18  |
Eclipse User |
|
|
|
Interesting Ketan! Thanks very much. It is useful and interesting to
hover over different objects in my GUI and see how the structure changes.
But how to map this information to the SWTBot objects and methods to write
the code? For example, I just tried it out on what to me looks like a
dialogue box with some kind of container in it that includes a grid of
checkboxes. I hovered over one of the checkboxes and press ctrl-shift.
This is the location indicated:
Location:
//Shell/-1//Shell/-1//Composite/0//Composite/0//Composite/1/ /Tree/1
So, how to map these items indicated (like shell, composite, etc) to the
SWTBot objects? For example, it probably wouldn't work if I just directly
referenced "bot.tree" here because that tree is part of another object...?
But yet I can't seem to find any bot method that returns a SWTBotComposite
object...
Also strange that even though I was clearly hovering over a checkbox, it
did not indicate it. (But if I hover over a button, it does indicate
"button").
Here's the rest of the output from the EclipseSpy View. Thanks a lot!
-Steve
Layout Information:
Tree {}
Style: MULTI | CHECK | HORIZONTAL | VERTICAL | BORDER | FLAT |
LEFT_TO_RIGHT
Layout Data: GridData {horizontalAlignment=SWT.FILL
grabExcessHorizontalSpace=true verticalAlignment=SWT.FILL
grabExcessVerticalSpace=true}
Bounds: Rectangle {5, 23, 372, 243}
Children: 0
Siblings: 2
Label {Include selected ele...}: Layout Data: GridData
{horizontalAlignment=SWT.FILL grabExcessHorizontalSpace=true
verticalAlignment=GridData.CENTER}
[*]Tree {}: Layout Data: GridData {horizontalAlignment=SWT.FILL
grabExcessHorizontalSpace=true verticalAlignment=SWT.FILL
grabExcessVerticalSpace=true}
Parent Tree:
Composite {}[1]@
Layout: GridLayout
LayoutData: GridData
Composite {}[0]@
Layout: GridLayout
LayoutData: GridData
Composite {}[0]@
Layout: GridLayout
LayoutData: GridData
Shell {Overview Diagram Sel...}[-1]@
Layout: GridLayout
LayoutData: null
Shell {Data - \datadesignpr...}[-1]@
Layout: TrimLayout
LayoutData: null
|
|
|
Powered by
FUDForum. Page generated in 0.29620 seconds