Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 08:16 Go to next message
Eclipse UserFriend
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 #32791 is a reply to message #32787] Mon, 26 September 2005 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thorsten_i.yahoo.com

Making further tests I realized that AGR does not record any actions on
the menu bar, except for the "File" menu. Whenever I record a test using
one of the other menu items, I receive the following (copied from error
log):

!ENTRY org.eclipse.ui.workbench 4 0 2005-09-26 16:20:24.254
!MESSAGE An unexpected exception was thrown.
!STACK 0
java.lang.NullPointerException
at
org.eclipse.tptp.test.auto.gui.internal.editor.AutoGUITestCa sesForm$AutoGUITestCaseDetailsProvider.dispose(AutoGUITestCa sesForm.java:498)
at
org.eclipse.hyades.test.ui.internal.editor.form.util.Details PageProvider.dispose(DetailsPageProvider.java:54)
at
org.eclipse.hyades.test.ui.internal.editor.form.util.DetailP ropertiesSection.dispose(DetailPropertiesSection.java:106)
at
org.eclipse.hyades.test.tools.ui.common.internal.editor.Test CasesEclipseForm.dispose(TestCasesEclipseForm.java:143)
at
org.eclipse.hyades.test.tools.ui.common.internal.editor.Test SuiteEditorExt.dispose(TestSuiteEditorExt.java:60)
at
org.eclipse.tptp.test.auto.gui.internal.editor.AutoGUIEditor Extension.dispose(AutoGUIEditorExtension.java:92)
at
org.eclipse.hyades.ui.internal.editor.HyadesEditorPart.dispo se(HyadesEditorPart.java:90)
at
org.eclipse.hyades.test.ui.internal.editor.BaseEditorPart.di spose(BaseEditorPart.java:83)
at
org.eclipse.ui.internal.WorkbenchPartReference.doDisposePart (WorkbenchPartReference.java:659)
at
org.eclipse.ui.internal.EditorReference.doDisposePart(Editor Reference.java:252)
at
org.eclipse.ui.internal.WorkbenchPartReference.dispose(Workb enchPartReference.java:628)
at
org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchP age.java:1432)
at
org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(W orkbenchPage.java:1259)
at
org.eclipse.ui.internal.WorkbenchPage.deferUpdates(Workbench Page.java:1243)
at
org.eclipse.ui.internal.WorkbenchPage.closeEditors(Workbench Page.java:1217)
at
org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchP age.java:1272)
at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:54 )
at org.eclipse.ui.internal.PartStack.close(PartStack.java:495)
at org.eclipse.ui.internal.EditorStack.close(EditorStack.java:1 97)
at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:102 )
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation$1.handleEvent(TabbedStackPresentation.java:81)
at
org.eclipse.ui.internal.presentations.util.AbstractTabFolder .fireEvent(AbstractTabFolder.java:267)
at
org.eclipse.ui.internal.presentations.util.AbstractTabFolder .fireEvent(AbstractTabFolder.java:276)
at
org.eclipse.ui.internal.presentations.defaultpresentation.De faultTabFolder.access$1(DefaultTabFolder.java:1)
at
org.eclipse.ui.internal.presentations.defaultpresentation.De faultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:67 )
at
org.eclipse.ui.internal.presentations.PaneFolder.notifyClose Listeners(PaneFolder.java:563)
at
org.eclipse.ui.internal.presentations.PaneFolder$3.close(Pan eFolder.java:190)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:20 75)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.j ava:292)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

!ENTRY org.eclipse.hyades.test.core 1 0 2005-09-26 16:43:27.263
!MESSAGE
org.eclipse.hyades.internal.execution.local.control.Inactive ProcessException
!STACK 0
org.eclipse.hyades.internal.execution.local.control.Inactive ProcessException
at
org.eclipse.hyades.execution.harness.TestExecutionHarnessExe cutorStub.launch(TestExecutionHarnessExecutorStub.java:183)
at
org.eclipse.hyades.execution.harness.TestExecutionHarness.la unchTestExecution(TestExecutionHarness.java:1957)
at
org.eclipse.hyades.execution.harness.TestExecutionHarness.ac cess$2(TestExecutionHarness.java:1749)
at
org.eclipse.hyades.execution.harness.TestExecutionHarness$2. run(TestExecutionHarness.java:656)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


Can anyone help me on that?

Thank you,
Regards,
Thorsten
Re: Using AGR with own plug-in [message #32805 is a reply to message #32787] Mon, 26 September 2005 18:59 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
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 #32819 is a reply to message #32805] Tue, 27 September 2005 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thorsten_i.yahoo.com

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 #32881 is a reply to message #32819] Tue, 27 September 2005 13:46 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
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 #32915 is a reply to message #32881] Wed, 28 September 2005 08:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thorsten_i.yahoo.com

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 #32949 is a reply to message #32915] Wed, 28 September 2005 13:55 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
ake sure that the 'use current workbench as context' option is checked in
the overview page of the test suite. I think you're question (So, how do I
get the launched playback workbench to be the exact duplicate of the
workbench I record in?) should instead be how you can get the workbench that
you use for recording to be the same as the one that you play your macro in.
Start a fresh workbench with a new workspace. Record your test in the
freshly launched workbench. For as long as you don't take any actions that
drastically changes the state of the workbench, then the launched instance
of Eclipse should be equivalent to the fresh instance that you used for your
recording.



In the future (hopefully in 4.2) I will be providing the user with the
ability to specify a workspace for the launched instance of the Eclipse
workbench that is used for playback. Until then, AGR makes the assumption
that the state of the recording workbench is the same as the context that is
used for playback.


"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 #32982 is a reply to message #32915] Wed, 28 September 2005 19:25 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
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 20:11 Go to previous messageGo to next message
Marius Slavescu is currently offline Marius SlavescuFriend
Messages: 67
Registered: July 2009
Member
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] Thu, 29 September 2005 01:02 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
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 #33161 is a reply to message #32982] Thu, 29 September 2005 13:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thorsten_i.yahoo.com

Hey Ali,

you're right. I did not notice the title menu difference either. Changing
the numbers to 8|4|8 makes the makro run past this point. But I get
another error which I think is caused by clicking the "OK" button in the
show view dialog.
Re: Using AGR with own plug-in [message #33264 is a reply to message #33161] Thu, 29 September 2005 15:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thorsten_i.yahoo.com

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?
Re: Using AGR with own plug-in [message #33299 is a reply to message #33264] Thu, 29 September 2005 18:02 Go to previous message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
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?
>
>
>
>
>
Previous Topic:Questions about IAC
Next Topic:TPTP Junit testing
Goto Forum:
  


Current Time: Thu Apr 25 17:11:46 GMT 2024

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

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

Back to the top