Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Position independent item-select in AGR
Position independent item-select in AGR [message #61050] Tue, 28 March 2006 14:28 Go to next message
Eclipse UserFriend
Originally posted by: eclipse.shedid.de

Hello everybody,

we're trying test our eclipse plugins with the AGR. Some of our views
contain tree widgets which are controlled by the plugin via JFace
TreeViewer.

I can record the selection of items in the tree with the recorder, but
the command stored is based on the relative position of items in the
tree structure as shown below.

-------
<command type="item-select" contextId="view/com.packgae.SomeTreeView"
widgetId="org.eclipse.swt.widgets.Tree#1">
<item path="com.package.SomeClassl0|0||9|"/>
</command>
-------

Unforunately I have really no influence on the position at which the
item may appear when replaying the test and so the tests will fail in
most cases because items are on different positions in the tree.

So my questions is if there is any other method to select the items
without knowing thier position, e.g. by the label or by any properties
of the object?

I really need to select the items, verification of existence (could be
done by hooks) is not enough, because I want to call the context menu.

Thanks in advance for your help,

best regards,

Dirk
Re: Position independent item-select in AGR [message #61332 is a reply to message #61050] Tue, 28 March 2006 16:49 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
Hello Dirk,

You can use the adaptive widget resolver to make your test cases more
robust. You can define properties on your class "com.package.SomeClass"
that are better identifiers than what AGR uses by default. (see
http://www.eclipse.org/tptp/test/documents/userguides/Intro- Auto-GUI-4-2-0.html#2.4.1)

An extension point is also provided for registering more advanced widget
resolvers but the extension point and its required interface are internal at
this point.


"Dirk Bernsau" <eclipse@shedid.de> wrote in message
news:e0bh6p$3aj$1@utils.eclipse.org...
> Hello everybody,
>
> we're trying test our eclipse plugins with the AGR. Some of our views
> contain tree widgets which are controlled by the plugin via JFace
> TreeViewer.
>
> I can record the selection of items in the tree with the recorder, but
> the command stored is based on the relative position of items in the
> tree structure as shown below.
>
> -------
> <command type="item-select" contextId="view/com.packgae.SomeTreeView"
> widgetId="org.eclipse.swt.widgets.Tree#1">
> <item path="com.package.SomeClassl0|0||9|"/>
> </command>
> -------
>
> Unforunately I have really no influence on the position at which the
> item may appear when replaying the test and so the tests will fail in
> most cases because items are on different positions in the tree.
>
> So my questions is if there is any other method to select the items
> without knowing thier position, e.g. by the label or by any properties
> of the object?
>
> I really need to select the items, verification of existence (could be
> done by hooks) is not enough, because I want to call the context menu.
>
> Thanks in advance for your help,
>
> best regards,
>
> Dirk
Re: Position independent item-select in AGR [message #61830 is a reply to message #61050] Wed, 29 March 2006 10:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mvjaibharatreddy.yahoo.com

Hi dirk,

I am bit surprised about your comment :

> I can record the selection of items in the tree with the recorder, but the
> command stored is based on the relative position of items in the tree
> structure as shown below.

How your macro is based on relative position ? . Can you explain what you
mean by relative position? .

cheers
Jai

"Dirk Bernsau" <eclipse@shedid.de> wrote in message
news:e0bh6p$3aj$1@utils.eclipse.org...
> Hello everybody,
>
> we're trying test our eclipse plugins with the AGR. Some of our views
> contain tree widgets which are controlled by the plugin via JFace
> TreeViewer.
>
> I can record the selection of items in the tree with the recorder, but the
> command stored is based on the relative position of items in the tree
> structure as shown below.
>
> -------
> <command type="item-select" contextId="view/com.packgae.SomeTreeView"
> widgetId="org.eclipse.swt.widgets.Tree#1">
> <item path="com.package.SomeClassl0|0||9|"/>
> </command>
> -------
>
> Unforunately I have really no influence on the position at which the item
> may appear when replaying the test and so the tests will fail in most
> cases because items are on different positions in the tree.
>
> So my questions is if there is any other method to select the items
> without knowing thier position, e.g. by the label or by any properties of
> the object?
>
> I really need to select the items, verification of existence (could be
> done by hooks) is not enough, because I want to call the context menu.
>
> Thanks in advance for your help,
>
> best regards,
>
> Dirk
Re: Position independent item-select in AGR [message #61876 is a reply to message #61830] Wed, 29 March 2006 11:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.shedid.de

Hi,

> How your macro is based on relative position ? . Can you explain what you
> mean by relative position? .

I give you some examples:

When I select the third child of the first top level element in the
tree, which is an object of class ClassificationScheme, it records as

<item path="com.xxx.ClassificationScheme0|2|"/>

because indexing starts with 0.

When I select the first child of the fourth child of the first top level
element in the tree, which is an object of class Concept, it records as

<item path="com.xxx.Concept0|3||0|"/>

I dont't know why there are to pipe characters between 3 and 0 in the
second command.

My problem is that I don't know at which position the item will be at
replay time.

When recording selection of elements in the JDT PackageExplorer, the
recording looks different:

<item path="org.eclipse.swt.widgets.TreeItem#{{/GUITest/src}}-{{1.0}} "/>

Here the 'src' folder in the project GUITest will be selected.

The difference is, that here the TreeItem of SWT is adressed, and not
the object representing the entry in the tree. I've tried to convert
this to my needs but had no success within our TreeView. I then get a
NullPointerException in the AutoGUIRunner$1$MacroPlayWrapper.run().

Maybe someone can explain in detail what the syntax of
....TreeItem#{{/GUITest/src}}-{{1.0}}... is about.

Regards,

Dirk



> cheers
> Jai
>
> "Dirk Bernsau" <eclipse@shedid.de> wrote in message
> news:e0bh6p$3aj$1@utils.eclipse.org...
>
>>Hello everybody,
>>
>>we're trying test our eclipse plugins with the AGR. Some of our views
>>contain tree widgets which are controlled by the plugin via JFace
>>TreeViewer.
>>
>>I can record the selection of items in the tree with the recorder, but the
>>command stored is based on the relative position of items in the tree
>>structure as shown below.
>>
>>-------
>><command type="item-select" contextId="view/com.packgae.SomeTreeView"
>>widgetId="org.eclipse.swt.widgets.Tree#1">
>><item path="com.package.SomeClassl0|0||9|"/>
>></command>
>>-------
>>
>>Unforunately I have really no influence on the position at which the item
>>may appear when replaying the test and so the tests will fail in most
>>cases because items are on different positions in the tree.
>>
>>So my questions is if there is any other method to select the items
>>without knowing thier position, e.g. by the label or by any properties of
>>the object?
>>
>>I really need to select the items, verification of existence (could be
>>done by hooks) is not enough, because I want to call the context menu.
>>
>>Thanks in advance for your help,
>>
>>best regards,
>>
>>Dirk
>
>
>
Re: Position independent item-select in AGR [message #62247 is a reply to message #61876] Wed, 29 March 2006 16:41 Go to previous message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
Actually the tree item that you referenced below is resolved using its
underlying data item. The reason why it's resolved is because of the
following registration entry under widgetReg.xml:



<class name = "org.eclipse.jdt.core.IJavaElement" matchThreshold = "1.0">
<method name = "getPath" weight = "1.0"/>
</class>



If you provide a similar registration, you'll be able to resolve the tree
item using better means than the tree item's indices.


"Dirk Bernsau" <eclipse@shedid.de> wrote in message
news:e0drv2$ul1$1@utils.eclipse.org...
> Hi,
>
> > How your macro is based on relative position ? . Can you explain what
you
> > mean by relative position? .
>
> I give you some examples:
>
> When I select the third child of the first top level element in the
> tree, which is an object of class ClassificationScheme, it records as
>
> <item path="com.xxx.ClassificationScheme0|2|"/>
>
> because indexing starts with 0.
>
> When I select the first child of the fourth child of the first top level
> element in the tree, which is an object of class Concept, it records as
>
> <item path="com.xxx.Concept0|3||0|"/>
>
> I dont't know why there are to pipe characters between 3 and 0 in the
> second command.
>
> My problem is that I don't know at which position the item will be at
> replay time.
>
> When recording selection of elements in the JDT PackageExplorer, the
> recording looks different:
>
> <item path="org.eclipse.swt.widgets.TreeItem#{{/GUITest/src}}-{{1.0}} "/>
>
> Here the 'src' folder in the project GUITest will be selected.
>
> The difference is, that here the TreeItem of SWT is adressed, and not
> the object representing the entry in the tree. I've tried to convert
> this to my needs but had no success within our TreeView. I then get a
> NullPointerException in the AutoGUIRunner$1$MacroPlayWrapper.run().
>
> Maybe someone can explain in detail what the syntax of
> ...TreeItem#{{/GUITest/src}}-{{1.0}}... is about.
>
> Regards,
>
> Dirk
>
>
>
> > cheers
> > Jai
> >
> > "Dirk Bernsau" <eclipse@shedid.de> wrote in message
> > news:e0bh6p$3aj$1@utils.eclipse.org...
> >
> >>Hello everybody,
> >>
> >>we're trying test our eclipse plugins with the AGR. Some of our views
> >>contain tree widgets which are controlled by the plugin via JFace
> >>TreeViewer.
> >>
> >>I can record the selection of items in the tree with the recorder, but
the
> >>command stored is based on the relative position of items in the tree
> >>structure as shown below.
> >>
> >>-------
> >><command type="item-select" contextId="view/com.packgae.SomeTreeView"
> >>widgetId="org.eclipse.swt.widgets.Tree#1">
> >><item path="com.package.SomeClassl0|0||9|"/>
> >></command>
> >>-------
> >>
> >>Unforunately I have really no influence on the position at which the
item
> >>may appear when replaying the test and so the tests will fail in most
> >>cases because items are on different positions in the tree.
> >>
> >>So my questions is if there is any other method to select the items
> >>without knowing thier position, e.g. by the label or by any properties
of
> >>the object?
> >>
> >>I really need to select the items, verification of existence (could be
> >>done by hooks) is not enough, because I want to call the context menu.
> >>
> >>Thanks in advance for your help,
> >>
> >>best regards,
> >>
> >>Dirk
> >
> >
> >
Previous Topic:Where does remote deployed test look for its depended plugins
Next Topic:wait command in AGR testcases
Goto Forum:
  


Current Time: Fri Dec 27 11:39:30 GMT 2024

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

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

Back to the top