Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to determine on-screen object hierarchy structure?
How to determine on-screen object hierarchy structure? [message #32535] Fri, 17 April 2009 06:31 Go to next message
Steven Chamberlin is currently offline Steven ChamberlinFriend
Messages: 30
Registered: July 2009
Member
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 #32571 is a reply to message #32535] Fri, 17 April 2009 07:37 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
You can open the eclipse spy view and hit CTRL+SHIFT. Then hover on a
control, then hit CTRL+SHIFT again to 'lock' on that control to get
information on the nesting of controls.

I'm just curious why you want to do this, isnt the text on the control
enough to find it ? SWTBot also provides for inGroup* methods to find
controls within a particular group.

-- Ketan


On 17/4/09 12:01, Steven Chamberlin wrote:
> 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 08:18 Go to previous message
Steven Chamberlin is currently offline Steven ChamberlinFriend
Messages: 30
Registered: July 2009
Member
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
Previous Topic:Are Dialog and ExpandBar supported?
Next Topic:java.lang.NoSuchMethodError while running SWTBot on Mac OS
Goto Forum:
  


Current Time: Fri Apr 26 22:25:53 GMT 2024

Powered by FUDForum. Page generated in 0.02966 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top