| Home » Archived » Test and Performance Tools Platform (TPTP) » Position independent item-select in AGR
 Goto Forum:| 
| Position independent item-select in AGR [message #61050] | Tue, 28 March 2006 09:28  |  | 
| Eclipse User  |  |  |  |  | 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 #61830 is a reply to message #61050] | Wed, 29 March 2006 05:55   |  | 
| Eclipse User  |  |  |  |  | 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 06:44   |  | 
| Eclipse User  |  |  |  |  | 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 11:41  |  | 
| Eclipse User  |  |  |  |  | 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
 > >
 > >
 > >
 |  |  |  | 
 
 
 Current Time: Fri Oct 31 02:17:25 EDT 2025 
 Powered by FUDForum . Page generated in 0.04764 seconds |