Home » Archived » Test and Performance Tools Platform (TPTP) » Using AGR with own plug-in
Using AGR with own plug-in [message #32787] |
Mon, 26 September 2005 04:16  |
Eclipse User |
|
|
|
Originally posted by: thorsten_i.yahoo.com
Hello,
since AGR cannot be used for an Eclipse RCP yet, I decided to create an
SWT GUI and integrated it (plug-in) as a view into Eclipse . This way I
can test how the Widget Resolver works and create several test cases.
Unfortunately, changing the view during recording doesn't seem to be
supported, yet. Any idea how I can make my plug-in view recordable?
Regards,
Thorsten
|
|
| |
Re: Using AGR with own plug-in [message #32805 is a reply to message #32787] |
Mon, 26 September 2005 14:59   |
Eclipse User |
|
|
|
Hi Thorsten,
Switching views should be supported in AGR. The way that it is supported is
by recording the id of the view as the contextId attribute of most commands.
For example, if the focus command has a contextId corresponding to a view,
then the id is used to display the view and place focus on the specific
control that corresponds to the value of the widgetId attribute of the focus
command.
One way of switching to the view is through the menu bar (i.e. Window > Show
View > ...). You have indicated that you get an error when using a menu
item other than 'File'. This is odd, because I have used and tested menu
items other than the 'File' Menu. The stack trace that you have included is
not related to any of the recording APIs. They correspond to the test suite
editor.
I have put in a number of fixes in the last few weeks. Can you give this a
try with a new development build and tell me if you are still experiencing
similar problems.
Thanks.
"Thorsten" <thorsten_i@yahoo.com> wrote in message
news:cf07280b18a1c5f1248f2422bccf9e72$1@www.eclipse.org...
> Hello,
>
> since AGR cannot be used for an Eclipse RCP yet, I decided to create an
> SWT GUI and integrated it (plug-in) as a view into Eclipse . This way I
> can test how the Widget Resolver works and create several test cases.
> Unfortunately, changing the view during recording doesn't seem to be
> supported, yet. Any idea how I can make my plug-in view recordable?
>
>
> Regards,
> Thorsten
>
|
|
| |
Re: Using AGR with own plug-in [message #32881 is a reply to message #32819] |
Tue, 27 September 2005 09:46   |
Eclipse User |
|
|
|
The sequence of numbers: 6|4|8 are indices for the menu item that you
selected. If you start counting from the file menu to the window menu, then
it should be 6 (start counting from 0). If you start counting from the
first menu item of window to the 'show view' item, then that should be 4
(count the menu separators too). The menu item that you selected should be
the 8th one and should be the child of the 'show view' item.
Now the tricky thing about the 'show view' item is that its children are
determined by the perspective that you're in. Make sure that in whatever
context you are playing your macro in, this item exists. If it doesn't,
then tweak the macro a little by changing the indices in order for it to
find your desired item.
"Thorsten" <thorsten_i@yahoo.com> wrote in message
news:8faac614c82c31390c9131725fd99890$1@www.eclipse.org...
>I tried it with the version TPTP-4.1.0-200509250100, but still the same
>error. In the execution file it says: Cannot locate menu item:
>contribid/viewsShortlist6|4|8
>
> Now I think the problem is an inconsistent workbench. I probably messed up
> there. The menu bar positions represented by 6|4|8 are probably different
> in the playback workbench. But how can I make sure that recording
> workbench and playback workbench are the same? I always record in my
> current workbench, and I guess thats the way it is supposed to be. That
> means that the playback workbench has to contain all the projects and
> settings from in my recording workbench as well. But whenever I playback a
> test case I end up in an empty workbench. I tried to set the context, but
> obviously couldn't manage to get it right. Can you help me out on that?
>
> Thanks a lot,
> Regards,
> Thorsten
>
|
|
| | |
Re: Using AGR with own plug-in [message #32982 is a reply to message #32915] |
Wed, 28 September 2005 15:25   |
Eclipse User |
|
|
|
Hi Thorsten,
I just ran into a similar problem that you have been running to. The
problem is that when you start a fresh Eclipse workbench and switch to the
Java perspective, you get the following menu items:
File, Edit, Source, Refactor, Navigate, Search, Project, Run, Window, Help.
As soon as you create a new plugin, the menu items change to:
File, Edit, Navigate, Search, Project, Run, Window, Help
Thus causing the menu items for the recording workbench to be different from
the playback workbench. This throws off the indexing of the menu items and
confuses AGR. You have to change the indexing in the macro so that it
points to the right menu item.
i.e. Use (8|4|8) instead of (6|4|8)
"Thorsten" <thorsten_i@yahoo.com> wrote in message
news:3d09ae35bd2f80605ab48278f8a527f1$1@www.eclipse.org...
> Thanks again for the reply! I know what the numbers (6|4|8) represent and
> I checked the perspective several times. Again, I think the problem lies
> in the workbench. The workbench that is launched for playback is not equal
> to the workbench I record in. The playback workbench contains no projects,
> different views that are defaultly opened at the bottom of the page, and
> probably many other different things. So, how do I get the launched
> playback workbench to be the exact duplicate of the workbench I record in?
>
|
|
|
Re: Using AGR with own plug-in [message #33017 is a reply to message #32982] |
Wed, 28 September 2005 16:11   |
Eclipse User |
|
|
|
Ali,
It would probably make sense to have the control label/text (were
applicable) in the macro so we could easily identify this kind of problems.
Regards,
Marius
"Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
news:dheqnq$4kv$1@news.eclipse.org...
> Hi Thorsten,
>
> I just ran into a similar problem that you have been running to. The
> problem is that when you start a fresh Eclipse workbench and switch to the
> Java perspective, you get the following menu items:
> File, Edit, Source, Refactor, Navigate, Search, Project, Run, Window,
Help.
>
> As soon as you create a new plugin, the menu items change to:
> File, Edit, Navigate, Search, Project, Run, Window, Help
>
> Thus causing the menu items for the recording workbench to be different
from
> the playback workbench. This throws off the indexing of the menu items
and
> confuses AGR. You have to change the indexing in the macro so that it
> points to the right menu item.
>
> i.e. Use (8|4|8) instead of (6|4|8)
>
>
> "Thorsten" <thorsten_i@yahoo.com> wrote in message
> news:3d09ae35bd2f80605ab48278f8a527f1$1@www.eclipse.org...
> > Thanks again for the reply! I know what the numbers (6|4|8) represent
and
> > I checked the perspective several times. Again, I think the problem lies
> > in the workbench. The workbench that is launched for playback is not
equal
> > to the workbench I record in. The playback workbench contains no
projects,
> > different views that are defaultly opened at the bottom of the page, and
> > probably many other different things. So, how do I get the launched
> > playback workbench to be the exact duplicate of the workbench I record
in?
> >
>
>
|
|
|
Re: Using AGR with own plug-in [message #33053 is a reply to message #33017] |
Wed, 28 September 2005 21:02   |
Eclipse User |
|
|
|
Good idea. I've opened an enhancement to follow upon it:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=111018
"Marius Slavescu" <slavescu@ca.ibm.com> wrote in message
news:dhetdg$8ca$1@news.eclipse.org...
> Ali,
>
> It would probably make sense to have the control label/text (were
> applicable) in the macro so we could easily identify this kind of
problems.
>
> Regards,
> Marius
>
>
> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
> news:dheqnq$4kv$1@news.eclipse.org...
> > Hi Thorsten,
> >
> > I just ran into a similar problem that you have been running to. The
> > problem is that when you start a fresh Eclipse workbench and switch to
the
> > Java perspective, you get the following menu items:
> > File, Edit, Source, Refactor, Navigate, Search, Project, Run, Window,
> Help.
> >
> > As soon as you create a new plugin, the menu items change to:
> > File, Edit, Navigate, Search, Project, Run, Window, Help
> >
> > Thus causing the menu items for the recording workbench to be different
> from
> > the playback workbench. This throws off the indexing of the menu items
> and
> > confuses AGR. You have to change the indexing in the macro so that it
> > points to the right menu item.
> >
> > i.e. Use (8|4|8) instead of (6|4|8)
> >
> >
> > "Thorsten" <thorsten_i@yahoo.com> wrote in message
> > news:3d09ae35bd2f80605ab48278f8a527f1$1@www.eclipse.org...
> > > Thanks again for the reply! I know what the numbers (6|4|8) represent
> and
> > > I checked the perspective several times. Again, I think the problem
lies
> > > in the workbench. The workbench that is launched for playback is not
> equal
> > > to the workbench I record in. The playback workbench contains no
> projects,
> > > different views that are defaultly opened at the bottom of the page,
and
> > > probably many other different things. So, how do I get the launched
> > > playback workbench to be the exact duplicate of the workbench I record
> in?
> > >
> >
> >
>
>
|
|
| | |
Re: Using AGR with own plug-in [message #33299 is a reply to message #33264] |
Thu, 29 September 2005 14:02  |
Eclipse User |
|
|
|
Hi Thorsten,
If you open the widget registeration file in
<ECLIPSE-HOME> \plugins\org.eclipse.tptp.test.auto.gui_4.1.0\auto-gui\widge tReg.xml,
you'll find an entry corresponding to buttons:
<class name = "org.eclipse.swt.widgets.Button" matchThreshold = "1.0">
<method name = "getData" weight = "1.0"/>
</class>
In SWT, some buttons contain an Integer object stored as a data attribute
that can be used as a persistent idetifier. If such an ID exists, then the
recorder will use it (just in your case). If not, then indexing will be
used. The entries {{0}}-{{0.9}} correspond to value and weight pairs that
are used to identify a widget. In your case, 0 is stored in the data
attribute of your button, and 0.9 is suppose to be the weight. I can't
explain why the weight is 0.9 as opposed to 1.0 (which matches the
matchThreshold of the attribute in the fragment above). I suspect that you
changed this number in your macro.
As for your questions:
1) I think providing the user with the ability to provide a custom
workspace for the playback workbench is better than forcing the user to use
a fresh workspace for their recording workbench.
2) Writing Java code corresponding to a target that a user selects gives
users a lot more flexibility than any verification mechanism that can be
automated. There are no plans for introducing any automated mechanisms for
verification.
"Thorsten " <thorsten_i@yahoo.com> wrote in message
news:94b1301cd1cae2b855871a7c142b8821$1@www.eclipse.org...
> Sorry...pressed the "enter" button by mistake ;)
>
> Ok, the error connected to the "OK" button is in the following command:
>
> <command type="select" contextId="shell"
> widgetId="org.eclipse.swt.widgets.Button#{{0}}-{{0.9}}"/>
>
> Can you explain what "{{0}}-{{0.9}}" represents?
>
> There are several more issues I have questions about. 1) I think the
> workbench issue is very confusing. The first intuition I had when trying
> out AGR was recording random clicks on my existing projects in the Package
> Explorer. When I then wanted to play back the script I realized the the
> launched workbench does not contain any of my projects, in fact it is a
> completely empty workbench and therefore totally different from the one I
> use. Maybe it would be better to launch a fresh workbench each time the
> user wants to record (and specify a workspace for the recordings) and
> launch that exact workspace when playing back from the script. What do you
> think of that?
>
>
> 2) Using verification hooks, the user has to manually add java code to the
> class. Is it planned to automate this procedure?
>
>
>
>
>
|
|
|
Goto Forum:
Current Time: Sat May 10 16:05:08 EDT 2025
Powered by FUDForum. Page generated in 0.09864 seconds
|