| Home » Archived » Test and Performance Tools Platform (TPTP) » AGR Test Case playback problem with dialog box
 Goto Forum:| 
| AGR Test Case playback problem with dialog box [message #54449] | Thu, 23 February 2006 09:53  |  | 
| Eclipse User  |  |  |  |  | Hi All, 
 I am encoutering problems when playing back my recorded Test Cases.
 
 I am going through a wizard in one of our plug-ins and the last dialog box
 asks if you want to build the imported project now.  When I record it I
 click yes and I can see the MakeFile evoked and displayed in the console as
 it builds.  When I play it back (in both execution and in quick-run) it
 hangs on that last dialog box.  I can still see the project building in the
 console, but the dialog box remains.  I have build-automatically turned off
 and I know it is a JFace dialog box.
 
 I have tried this on both TPTP 4.2 (4.2.0-200602220100) with Eclipse 3.2 M5
 and also with TPTP 4.1 with Eclipse 3.2 M4.
 
 If anyone has any suggestions I would be very grateful!
 
 Thanks in advance!
 
 Heidi
 |  |  |  |  |  |  | 
| Re: AGR Test Case playback problem with dialog box [message #54504 is a reply to message #54449] | Thu, 23 February 2006 17:11   |  | 
| Eclipse User  |  |  |  |  | Is the dialog org.eclipse.jface.dialogs.MessageDialog?  If so, then it should be able to record it.  I have tested this out before.  I know that
 dialogs that are of type org.eclipse.swt.widgets.MessageBox won't be
 recorded - see the post below:
 
 
 ------------------------------------------------------------ ------------
 Hi Stephan,
 
 Yes, you're right.  The MessageBox is a native dialog, but MessageDialog
 isn't.
 You can use a message dialog as follows:
 
 MessageDialog md = new MessageDialog
 (HelloWorldPlugin.getDefault().getWorkbench().getActiveWorkb enchWindow().get
 Shell(), "Title", null, "Message", MessageDialog.NONE, new String[]{"Yes",
 "No"}, 0);
 return md.open() == 0;
 
 Unfortunately I can't think of any other workarounds that you can use
 without the need to change your code.
 Thanks.
 
 ---------------------------------------------------
 "Stephan Lips" <stephan.lips@xxxxxxxx> wrote in message
 news:dru1sg$e92$1@xxxxxxxxe.org...
 
 Greetings,
 
 we use using AGR/TPTP 4.1 in Eclipse 3.1.  A scenario I am automating
 involves a simple confirmation dialog that is invoked by the plugin under
 test as follows
 MessageBox replicate = new MessageBox(getShell(), SWT.YES | SWT.NO);
 replicate.setMessage(REP_MSG_1);
 replicate.setText(REP_MSG_2);
 return replicate.open() == SWT.YES;
 When recording the scenario, AGR fails to recognize the replicate
 dialog/record any interaction with it, subsequent test execution fails
 with
 the message 'Timeout occured [...] This is likely caused by the presence
 of an unexpected dialog'.
 
 Is the SWT MessageBox a 'native' dialog as described in the AGR manual,
 section 1.2 'Known Limitations and Workarounds', and/or is there any
 workaround?  I would like to think that simple yes/no confirmation dialogs
 such as the one I am looking at are a pretty common occurence and there is
 
 away to make AGR work with it.
 
 Thanks much for any insight!
 
 - Stephan
 
 
 
 "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 news:dtki93$ktc$1@utils.eclipse.org...
 > Hi All,
 >
 > I am encoutering problems when playing back my recorded Test Cases.
 >
 > I am going through a wizard in one of our plug-ins and the last dialog box
 > asks if you want to build the imported project now.  When I record it I
 > click yes and I can see the MakeFile evoked and displayed in the console
 as
 > it builds.  When I play it back (in both execution and in quick-run) it
 > hangs on that last dialog box.  I can still see the project building in
 the
 > console, but the dialog box remains.  I have build-automatically turned
 off
 > and I know it is a JFace dialog box.
 >
 > I have tried this on both TPTP 4.2 (4.2.0-200602220100) with Eclipse 3.2
 M5
 > and also with TPTP 4.1 with Eclipse 3.2 M4.
 >
 > If anyone has any suggestions I would be very grateful!
 >
 > Thanks in advance!
 >
 > Heidi
 >
 >
 >
 |  |  |  |  | 
| Re: AGR Test Case playback problem with dialog box [message #54648 is a reply to message #54504] | Fri, 24 February 2006 10:35   |  | 
| Eclipse User  |  |  |  |  | Hi Ali, 
 Thanks for helping me out.
 
 The dialog is an "org.eclipse.jface.dialogs.MessageDialog".  I also found
 another dialog box that is of this type and it also behaves in this manner
 during playback. (the one that comes up when you try to close a file that
 hasn't been saved yet)
 
 The information is being recorded in the macro.  Perhaps the problem lies
 within the playback.
 
 Heidi
 
 "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 news:dtlbut$sl8$1@utils.eclipse.org...
 > Is the dialog org.eclipse.jface.dialogs.MessageDialog?  If so, then it
 > should be able to record it.  I have tested this out before.  I know that
 > dialogs that are of type org.eclipse.swt.widgets.MessageBox won't be
 > recorded - see the post below:
 >
 >
 >  ------------------------------------------------------------ ------------
 > Hi Stephan,
 >
 > Yes, you're right.  The MessageBox is a native dialog, but MessageDialog
 > isn't.
 > You can use a message dialog as follows:
 >
 > MessageDialog md = new MessageDialog
 >  (HelloWorldPlugin.getDefault().getWorkbench().getActiveWorkb enchWindow().get
 > Shell(), "Title", null, "Message", MessageDialog.NONE, new String[]{"Yes",
 > "No"}, 0);
 > return md.open() == 0;
 >
 > Unfortunately I can't think of any other workarounds that you can use
 > without the need to change your code.
 > Thanks.
 >
 > ---------------------------------------------------
 > "Stephan Lips" <stephan.lips@xxxxxxxx> wrote in message
 > news:dru1sg$e92$1@xxxxxxxxe.org...
 >
 >  Greetings,
 >
 >  we use using AGR/TPTP 4.1 in Eclipse 3.1.  A scenario I am automating
 >  involves a simple confirmation dialog that is invoked by the plugin under
 >  test as follows
 >      MessageBox replicate = new MessageBox(getShell(), SWT.YES | SWT.NO);
 >      replicate.setMessage(REP_MSG_1);
 >      replicate.setText(REP_MSG_2);
 >      return replicate.open() == SWT.YES;
 >  When recording the scenario, AGR fails to recognize the replicate
 >  dialog/record any interaction with it, subsequent test execution fails
 > with
 >  the message 'Timeout occured [...] This is likely caused by the presence
 >  of an unexpected dialog'.
 >
 >  Is the SWT MessageBox a 'native' dialog as described in the AGR manual,
 >  section 1.2 'Known Limitations and Workarounds', and/or is there any
 >  workaround?  I would like to think that simple yes/no confirmation
 > dialogs
 >  such as the one I am looking at are a pretty common occurence and there
 > is
 >
 >            away to make AGR work with it.
 >
 > Thanks much for any insight!
 >
 > - Stephan
 >
 >
 >
 > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 > news:dtki93$ktc$1@utils.eclipse.org...
 >> Hi All,
 >>
 >> I am encoutering problems when playing back my recorded Test Cases.
 >>
 >> I am going through a wizard in one of our plug-ins and the last dialog
 >> box
 >> asks if you want to build the imported project now.  When I record it I
 >> click yes and I can see the MakeFile evoked and displayed in the console
 > as
 >> it builds.  When I play it back (in both execution and in quick-run) it
 >> hangs on that last dialog box.  I can still see the project building in
 > the
 >> console, but the dialog box remains.  I have build-automatically turned
 > off
 >> and I know it is a JFace dialog box.
 >>
 >> I have tried this on both TPTP 4.2 (4.2.0-200602220100) with Eclipse 3.2
 > M5
 >> and also with TPTP 4.1 with Eclipse 3.2 M4.
 >>
 >> If anyone has any suggestions I would be very grateful!
 >>
 >> Thanks in advance!
 >>
 >> Heidi
 >>
 >>
 >>
 >
 >
 |  |  |  |  | 
| Re: AGR Test Case playback problem with dialog box [message #54911 is a reply to message #54648] | Fri, 24 February 2006 17:26   |  | 
| Eclipse User  |  |  |  |  | Good to hear that it's recorded.  Can you post your macro to this thread?  I just tested this with Feb 22nd driver and it worked fine when I attempted to
 close a *text* file that was marked dirty.  It didn't have a problem
 invoking the "no" button in the message dialog that prompts the user to
 save.
 
 Place a <command type="wait" time-to-wait="5000"/> just before the
 close-workbenchpart command to ensure that the editor is marked dirty.  I
 should say that there is a little catch if you are testing this with a Java
 file.  The Eclipse Java editor will only expand the import clause after the
 first modify.  Repeating the modify command will fix this.  This of course
 shouldn't be a problem if you are attempting to edit a text file.
 
 Here's the macro for editing a text file and clicking no when prompted to
 save:
 
 <macro version="0.1" >
 <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 <command type="item-select"
 contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 -{{1.0}}"/>
 </command>
 <command type="focus"
 contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 widgetId="org.eclipse.swt.widgets.Composite#1"/>
 <command type="default-select"
 contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 -{{1.0}}"/>
 </command>
 <command type="wait"/>
 <command type="modify"
 contextId="editor/org.eclipse.ui.DefaultTextEditor/myfile.txt "
 widgetId="org.eclipse.swt.custom.StyledText#1">
 <![CDATA[blah]]>
 </command>
 <command type="close-workbenchpart" contextId="editor"
 widgetId="org.eclipse.ui.DefaultTextEditor/myfile.txt"/>
 <shell id="org.eclipse.jface.dialogs.MessageDialog" return-code="1">
 <command type="select" contextId="shell"
 widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 </shell>
 </shell>
 </macro>
 
 
 
 
 "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 news:dtn93n$stl$1@utils.eclipse.org...
 > Hi Ali,
 >
 > Thanks for helping me out.
 >
 > The dialog is an "org.eclipse.jface.dialogs.MessageDialog".  I also found
 > another dialog box that is of this type and it also behaves in this manner
 > during playback. (the one that comes up when you try to close a file that
 > hasn't been saved yet)
 >
 > The information is being recorded in the macro.  Perhaps the problem lies
 > within the playback.
 >
 > Heidi
 >
 > "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 > news:dtlbut$sl8$1@utils.eclipse.org...
 > > Is the dialog org.eclipse.jface.dialogs.MessageDialog?  If so, then it
 > > should be able to record it.  I have tested this out before.  I know
 that
 > > dialogs that are of type org.eclipse.swt.widgets.MessageBox won't be
 > > recorded - see the post below:
 > >
 > >
 > >  ------------------------------------------------------------ ------------
 > > Hi Stephan,
 > >
 > > Yes, you're right.  The MessageBox is a native dialog, but MessageDialog
 > > isn't.
 > > You can use a message dialog as follows:
 > >
 > > MessageDialog md = new MessageDialog
 > >
 (HelloWorldPlugin.getDefault().getWorkbench().getActiveWorkb enchWindow().get
 > > Shell(), "Title", null, "Message", MessageDialog.NONE, new
 String[]{"Yes",
 > > "No"}, 0);
 > > return md.open() == 0;
 > >
 > > Unfortunately I can't think of any other workarounds that you can use
 > > without the need to change your code.
 > > Thanks.
 > >
 > > ---------------------------------------------------
 > > "Stephan Lips" <stephan.lips@xxxxxxxx> wrote in message
 > > news:dru1sg$e92$1@xxxxxxxxe.org...
 > >
 > >  Greetings,
 > >
 > >  we use using AGR/TPTP 4.1 in Eclipse 3.1.  A scenario I am automating
 > >  involves a simple confirmation dialog that is invoked by the plugin
 under
 > >  test as follows
 > >      MessageBox replicate = new MessageBox(getShell(), SWT.YES |
 SWT.NO);
 > >      replicate.setMessage(REP_MSG_1);
 > >      replicate.setText(REP_MSG_2);
 > >      return replicate.open() == SWT.YES;
 > >  When recording the scenario, AGR fails to recognize the replicate
 > >  dialog/record any interaction with it, subsequent test execution fails
 > > with
 > >  the message 'Timeout occured [...] This is likely caused by the
 presence
 > >  of an unexpected dialog'.
 > >
 > >  Is the SWT MessageBox a 'native' dialog as described in the AGR manual,
 > >  section 1.2 'Known Limitations and Workarounds', and/or is there any
 > >  workaround?  I would like to think that simple yes/no confirmation
 > > dialogs
 > >  such as the one I am looking at are a pretty common occurence and there
 > > is
 > >
 > >            away to make AGR work with it.
 > >
 > > Thanks much for any insight!
 > >
 > > - Stephan
 > >
 > >
 > >
 > > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 > > news:dtki93$ktc$1@utils.eclipse.org...
 > >> Hi All,
 > >>
 > >> I am encoutering problems when playing back my recorded Test Cases.
 > >>
 > >> I am going through a wizard in one of our plug-ins and the last dialog
 > >> box
 > >> asks if you want to build the imported project now.  When I record it I
 > >> click yes and I can see the MakeFile evoked and displayed in the
 console
 > > as
 > >> it builds.  When I play it back (in both execution and in quick-run) it
 > >> hangs on that last dialog box.  I can still see the project building in
 > > the
 > >> console, but the dialog box remains.  I have build-automatically turned
 > > off
 > >> and I know it is a JFace dialog box.
 > >>
 > >> I have tried this on both TPTP 4.2 (4.2.0-200602220100) with Eclipse
 3.2
 > > M5
 > >> and also with TPTP 4.1 with Eclipse 3.2 M4.
 > >>
 > >> If anyone has any suggestions I would be very grateful!
 > >>
 > >> Thanks in advance!
 > >>
 > >> Heidi
 > >>
 > >>
 > >>
 > >
 > >
 >
 >
 >
 |  |  |  |  | 
| Re: AGR Test Case playback problem with dialog box [message #55184 is a reply to message #54911] | Mon, 27 February 2006 11:45   |  | 
| Eclipse User  |  |  |  |  | This is my macro for testing the MessageDialog.  It does not have any dependencies, so it should run it as is.
 I asked my co-worker to test this macro, and he was also not able to select
 the "No" in the save MessageDialog box.
 
 Thanks so much!
 Heidi
 
 <macro version="0.1" >
 <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 <command type="select" contextId="menus"
 widgetId=" org.eclipse.ui.actions.NewWizardMenu#{{&File-&am p;New	Alt+Shift+N-P&roject...}}-{{0.8}}{{0|0 |0}}-{{0.6}}{{true}}-{{0.1}}{{5}}-{{0.1}}{{first}}-{{0.2}}{{ separator}}-{{0.2}} ">
 <parent widgetId="file"/>
 <parent widgetId="new"/>
 </command>
 <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
 <command type="item-select"
 contextId="wizard-page/newWizardSelectionPage"
 widgetId="org.eclipse.swt.widgets.Tree#1">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.pde.ui.NewPro jectWizard}}-{{1.0}} "/>
 </command>
 <command type="focus"
 contextId="wizard-page/newWizardSelectionPage"
 widgetId="org.eclipse.swt.widgets.Tree#1"/>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="modify" contextId="wizard-page/main"
 widgetId="org.eclipse.swt.widgets.Text#1">
 <![CDATA[test]]>
 </command>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
 <shell id="org.eclipse.jface.dialogs.MessageDialogWithToggle"
 return-code="2">
 <command type="select" contextId="shell"
 widgetId="org.eclipse.swt.widgets.Button#{{2}}-{{1.0}}"/>
 </shell>
 <command type="wait"/>
 </shell>
 <command type="wait"/>
 <command type="modify"
 contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF "
 widgetId="org.eclipse.swt.widgets.Text#5">
 <![CDATA[gdgd]]>
 </command>
 <command type="wait" time-to-wait="5000"/>
 <command type="select" contextId="menus"
 widgetId=" org.eclipse.jface.action.ActionContributionItem#{{&F ile-&Close	Ctrl+W}}-{{0.8}}{{0|3}}-{{0.6}}{{ false}}-{{0.1}}{{31}}-{{0.1}}{{separator}}-{{0.2}}{{C&am p;lose
 All	Ctrl+Shift+W}}-{{0.2}}">
 <parent widgetId="file"/>
 </command>
 <command type="wait" time-to-wait="5000"/>
 <command type="close-workbenchpart" contextId="editor"
 widgetId="org.eclipse.pde.ui.manifestEditor/MANIFEST.MF"/>
 <shell id="org.eclipse.jface.dialogs.MessageDialog" return-code="1">
 <command type="select" contextId="shell"
 widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 </shell>
 </shell>
 </macro>
 
 
 "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 news:dto17p$nal$1@utils.eclipse.org...
 > Good to hear that it's recorded.  Can you post your macro to this thread?
 > I
 > just tested this with Feb 22nd driver and it worked fine when I attempted
 > to
 > close a *text* file that was marked dirty.  It didn't have a problem
 > invoking the "no" button in the message dialog that prompts the user to
 > save.
 >
 > Place a <command type="wait" time-to-wait="5000"/> just before the
 > close-workbenchpart command to ensure that the editor is marked dirty.  I
 > should say that there is a little catch if you are testing this with a
 > Java
 > file.  The Eclipse Java editor will only expand the import clause after
 > the
 > first modify.  Repeating the modify command will fix this.  This of course
 > shouldn't be a problem if you are attempting to edit a text file.
 >
 > Here's the macro for editing a text file and clicking no when prompted to
 > save:
 >
 > <macro version="0.1" >
 >   <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 >      <command type="item-select"
 > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 > widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 >         <item
 > path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 > -{{1.0}}"/>
 >      </command>
 >      <command type="focus"
 > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 > widgetId="org.eclipse.swt.widgets.Composite#1"/>
 >      <command type="default-select"
 > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 > widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 >         <item
 > path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 > -{{1.0}}"/>
 >      </command>
 >      <command type="wait"/>
 >      <command type="modify"
 > contextId="editor/org.eclipse.ui.DefaultTextEditor/myfile.txt "
 > widgetId="org.eclipse.swt.custom.StyledText#1">
 >      <![CDATA[blah]]>
 >      </command>
 >      <command type="close-workbenchpart" contextId="editor"
 > widgetId="org.eclipse.ui.DefaultTextEditor/myfile.txt"/>
 >      <shell id="org.eclipse.jface.dialogs.MessageDialog" return-code="1">
 >         <command type="select" contextId="shell"
 > widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 >      </shell>
 >   </shell>
 > </macro>
 >
 >
 >
 >
 > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 > news:dtn93n$stl$1@utils.eclipse.org...
 >> Hi Ali,
 >>
 >> Thanks for helping me out.
 >>
 >> The dialog is an "org.eclipse.jface.dialogs.MessageDialog".  I also found
 >> another dialog box that is of this type and it also behaves in this
 >> manner
 >> during playback. (the one that comes up when you try to close a file that
 >> hasn't been saved yet)
 >>
 >> The information is being recorded in the macro.  Perhaps the problem lies
 >> within the playback.
 >>
 >> Heidi
 >>
 >> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 >> news:dtlbut$sl8$1@utils.eclipse.org...
 >> > Is the dialog org.eclipse.jface.dialogs.MessageDialog?  If so, then it
 >> > should be able to record it.  I have tested this out before.  I know
 > that
 >> > dialogs that are of type org.eclipse.swt.widgets.MessageBox won't be
 >> > recorded - see the post below:
 >> >
 >> >
 >> >  ------------------------------------------------------------ ------------
 >> > Hi Stephan,
 >> >
 >> > Yes, you're right.  The MessageBox is a native dialog, but
 >> > MessageDialog
 >> > isn't.
 >> > You can use a message dialog as follows:
 >> >
 >> > MessageDialog md = new MessageDialog
 >> >
 >  (HelloWorldPlugin.getDefault().getWorkbench().getActiveWorkb enchWindow().get
 >> > Shell(), "Title", null, "Message", MessageDialog.NONE, new
 > String[]{"Yes",
 >> > "No"}, 0);
 >> > return md.open() == 0;
 >> >
 >> > Unfortunately I can't think of any other workarounds that you can use
 >> > without the need to change your code.
 >> > Thanks.
 >> >
 >> > ---------------------------------------------------
 >> > "Stephan Lips" <stephan.lips@xxxxxxxx> wrote in message
 >> > news:dru1sg$e92$1@xxxxxxxxe.org...
 >> >
 >> >  Greetings,
 >> >
 >> >  we use using AGR/TPTP 4.1 in Eclipse 3.1.  A scenario I am automating
 >> >  involves a simple confirmation dialog that is invoked by the plugin
 > under
 >> >  test as follows
 >> >      MessageBox replicate = new MessageBox(getShell(), SWT.YES |
 > SWT.NO);
 >> >      replicate.setMessage(REP_MSG_1);
 >> >      replicate.setText(REP_MSG_2);
 >> >      return replicate.open() == SWT.YES;
 >> >  When recording the scenario, AGR fails to recognize the replicate
 >> >  dialog/record any interaction with it, subsequent test execution fails
 >> > with
 >> >  the message 'Timeout occured [...] This is likely caused by the
 > presence
 >> >  of an unexpected dialog'.
 >> >
 >> >  Is the SWT MessageBox a 'native' dialog as described in the AGR
 >> > manual,
 >> >  section 1.2 'Known Limitations and Workarounds', and/or is there any
 >> >  workaround?  I would like to think that simple yes/no confirmation
 >> > dialogs
 >> >  such as the one I am looking at are a pretty common occurence and
 >> > there
 >> > is
 >> >
 >> >            away to make AGR work with it.
 >> >
 >> > Thanks much for any insight!
 >> >
 >> > - Stephan
 >> >
 >> >
 >> >
 >> > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 >> > news:dtki93$ktc$1@utils.eclipse.org...
 >> >> Hi All,
 >> >>
 >> >> I am encoutering problems when playing back my recorded Test Cases.
 >> >>
 >> >> I am going through a wizard in one of our plug-ins and the last dialog
 >> >> box
 >> >> asks if you want to build the imported project now.  When I record it
 >> >> I
 >> >> click yes and I can see the MakeFile evoked and displayed in the
 > console
 >> > as
 >> >> it builds.  When I play it back (in both execution and in quick-run)
 >> >> it
 >> >> hangs on that last dialog box.  I can still see the project building
 >> >> in
 >> > the
 >> >> console, but the dialog box remains.  I have build-automatically
 >> >> turned
 >> > off
 >> >> and I know it is a JFace dialog box.
 >> >>
 >> >> I have tried this on both TPTP 4.2 (4.2.0-200602220100) with Eclipse
 > 3.2
 >> > M5
 >> >> and also with TPTP 4.1 with Eclipse 3.2 M4.
 >> >>
 >> >> If anyone has any suggestions I would be very grateful!
 >> >>
 >> >> Thanks in advance!
 >> >>
 >> >> Heidi
 >> >>
 >> >>
 >> >>
 >> >
 >> >
 >>
 >>
 >>
 >
 >
 |  |  |  |  | 
| Re: AGR Test Case playback problem with dialog box [message #55591 is a reply to message #55184] | Tue, 28 February 2006 15:01   |  | 
| Eclipse User  |  |  |  |  | The problem is caused because the recorder not only records your File > Close selection, but it also records a close-workbenchpart command.
 Here's a version of your macro that will work:
 
 <macro version="0.1" >
 <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 <command type="select" contextId="menus"
 widgetId=" org.eclipse.ui.actions.NewWizardMenu#{{&File-&am p;New	Alt+
 Shift+N-P&roject...}}-{{0.8}}{{0|0|0}}-{{0.6}}{{true }}-{{0.1}}{{5}}-{{0.
 1}}{{first}}-{{0.2}}{{separator}}-{{0.2}}">
 <parent widgetId="file"/>
 <parent widgetId="new"/>
 </command>
 <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
 <command type="item-select"
 contextId="wizard-page/newWizardSelectionPage"
 widgetId="org.eclipse.swt.widgets.Tree#1">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.pde.ui.NewPro jectWizard
 }}-{{1.0}}"/>
 </command>
 <command type="focus"
 contextId="wizard-page/newWizardSelectionPage"
 widgetId="org.eclipse.swt.widgets.Tree#1"/>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="modify" contextId="wizard-page/main"
 widgetId="org.eclipse.swt.widgets.Text#1">
 <![CDATA[test]]>
 </command>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
 <shell id="org.eclipse.jface.dialogs.MessageDialogWithToggle"
 return-code="2">
 <command type="select" contextId="shell"
 widgetId="org.eclipse.swt.widgets.Button#{{2}}-{{1.0}}"/>
 </shell>
 <command type="wait"/>
 </shell>
 <command type="wait"/>
 <command type="modify"
 contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF "
 widgetId="org.eclipse.swt.widgets.Text#5">
 <![CDATA[gdgd]]>
 </command>
 <command type="wait" time-to-wait="1000"/>
 <command type="select" contextId="menus"
 widgetId=" org.eclipse.jface.action.ActionContributionItem#{{&F ile-&C
 lose	Ctrl+W}}-{{0.8}}{{0|3}}-{{0.6}}{{false}}-{{0.1} }{{31}}-{{0.1}}{{sep
 arator}}-{{0.2}}{{C&lose All	Ctrl+Shift+W}}-{{0.2}}">
 <parent widgetId="file"/>
 </command>
 <shell id="org.eclipse.jface.dialogs.MessageDialog" return-code="1">
 <command type="select" contextId="shell"
 widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 </shell>
 </shell>
 </macro>
 
 
 I have re-opened defect https://bugs.eclipse.org/bugs/show_bug.cgi?id=110810
 to try and fix this.
 
 
 "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 news:dtvab4$r8u$1@utils.eclipse.org...
 > This is my macro for testing the MessageDialog.  It does not have any
 > dependencies, so it should run it as is.
 > I asked my co-worker to test this macro, and he was also not able to
 select
 > the "No" in the save MessageDialog box.
 >
 > Thanks so much!
 > Heidi
 >
 > <macro version="0.1" >
 >    <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 >       <command type="select" contextId="menus"
 >
 widgetId=" org.eclipse.ui.actions.NewWizardMenu#{{&File-&am p;New	Alt+
 Shift+N-P&roject...}}-{{0.8}}{{0|0|0}}-{{0.6}}{{true }}-{{0.1}}{{5}}-{{0.
 1}}{{first}}-{{0.2}}{{separator}}-{{0.2}}">
 >          <parent widgetId="file"/>
 >          <parent widgetId="new"/>
 >       </command>
 >       <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
 >          <command type="item-select"
 > contextId="wizard-page/newWizardSelectionPage"
 > widgetId="org.eclipse.swt.widgets.Tree#1">
 >             <item
 >
 path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.pde.ui.NewPro jectWizard
 }}-{{1.0}}"/>
 >          </command>
 >          <command type="focus"
 > contextId="wizard-page/newWizardSelectionPage"
 > widgetId="org.eclipse.swt.widgets.Tree#1"/>
 >          <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >          <command type="modify" contextId="wizard-page/main"
 > widgetId="org.eclipse.swt.widgets.Text#1">
 >          <![CDATA[test]]>
 >          </command>
 >          <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >          <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >          <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
 >          <shell id="org.eclipse.jface.dialogs.MessageDialogWithToggle"
 > return-code="2">
 >             <command type="select" contextId="shell"
 > widgetId="org.eclipse.swt.widgets.Button#{{2}}-{{1.0}}"/>
 >          </shell>
 >          <command type="wait"/>
 >       </shell>
 >       <command type="wait"/>
 >       <command type="modify"
 > contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF "
 > widgetId="org.eclipse.swt.widgets.Text#5">
 >       <![CDATA[gdgd]]>
 >       </command>
 >   <command type="wait" time-to-wait="5000"/>
 >       <command type="select" contextId="menus"
 >
 widgetId=" org.eclipse.jface.action.ActionContributionItem#{{&F ile-&C
 lose	Ctrl+W}}-{{0.8}}{{0|3}}-{{0.6}}{{false}}-{{0.1} }{{31}}-{{0.1}}{{sep
 arator}}-{{0.2}}{{C&lose
 > All	Ctrl+Shift+W}}-{{0.2}}">
 >          <parent widgetId="file"/>
 >       </command>
 >    <command type="wait" time-to-wait="5000"/>
 >       <command type="close-workbenchpart" contextId="editor"
 > widgetId="org.eclipse.pde.ui.manifestEditor/MANIFEST.MF"/>
 >       <shell id="org.eclipse.jface.dialogs.MessageDialog" return-code="1">
 >          <command type="select" contextId="shell"
 > widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 >       </shell>
 >    </shell>
 > </macro>
 >
 >
 > "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 > news:dto17p$nal$1@utils.eclipse.org...
 > > Good to hear that it's recorded.  Can you post your macro to this
 thread?
 > > I
 > > just tested this with Feb 22nd driver and it worked fine when I
 attempted
 > > to
 > > close a *text* file that was marked dirty.  It didn't have a problem
 > > invoking the "no" button in the message dialog that prompts the user to
 > > save.
 > >
 > > Place a <command type="wait" time-to-wait="5000"/> just before the
 > > close-workbenchpart command to ensure that the editor is marked dirty.
 I
 > > should say that there is a little catch if you are testing this with a
 > > Java
 > > file.  The Eclipse Java editor will only expand the import clause after
 > > the
 > > first modify.  Repeating the modify command will fix this.  This of
 course
 > > shouldn't be a problem if you are attempting to edit a text file.
 > >
 > > Here's the macro for editing a text file and clicking no when prompted
 to
 > > save:
 > >
 > > <macro version="0.1" >
 > >   <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 > >      <command type="item-select"
 > > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 > > widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 > >         <item
 > >
 path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 > > -{{1.0}}"/>
 > >      </command>
 > >      <command type="focus"
 > > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 > > widgetId="org.eclipse.swt.widgets.Composite#1"/>
 > >      <command type="default-select"
 > > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 > > widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 > >         <item
 > >
 path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 > > -{{1.0}}"/>
 > >      </command>
 > >      <command type="wait"/>
 > >      <command type="modify"
 > > contextId="editor/org.eclipse.ui.DefaultTextEditor/myfile.txt "
 > > widgetId="org.eclipse.swt.custom.StyledText#1">
 > >      <![CDATA[blah]]>
 > >      </command>
 > >      <command type="close-workbenchpart" contextId="editor"
 > > widgetId="org.eclipse.ui.DefaultTextEditor/myfile.txt"/>
 > >      <shell id="org.eclipse.jface.dialogs.MessageDialog"
 return-code="1">
 > >         <command type="select" contextId="shell"
 > > widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 > >      </shell>
 > >   </shell>
 > > </macro>
 > >
 > >
 > >
 > >
 > > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 > > news:dtn93n$stl$1@utils.eclipse.org...
 > >> Hi Ali,
 > >>
 > >> Thanks for helping me out.
 > >>
 > >> The dialog is an "org.eclipse.jface.dialogs.MessageDialog".  I also
 found
 > >> another dialog box that is of this type and it also behaves in this
 > >> manner
 > >> during playback. (the one that comes up when you try to close a file
 that
 > >> hasn't been saved yet)
 > >>
 > >> The information is being recorded in the macro.  Perhaps the problem
 lies
 > >> within the playback.
 > >>
 > >> Heidi
 > >>
 > >> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 > >> news:dtlbut$sl8$1@utils.eclipse.org...
 > >> > Is the dialog org.eclipse.jface.dialogs.MessageDialog?  If so, then
 it
 > >> > should be able to record it.  I have tested this out before.  I know
 > > that
 > >> > dialogs that are of type org.eclipse.swt.widgets.MessageBox won't be
 > >> > recorded - see the post below:
 > >> >
 > >> >
 > >>
 >  ------------------------------------------------------------ ------------
 > >> > Hi Stephan,
 > >> >
 > >> > Yes, you're right.  The MessageBox is a native dialog, but
 > >> > MessageDialog
 > >> > isn't.
 > >> > You can use a message dialog as follows:
 > >> >
 > >> > MessageDialog md = new MessageDialog
 > >> >
 > >
 (HelloWorldPlugin.getDefault().getWorkbench().getActiveWorkb enchWindow().get
 > >> > Shell(), "Title", null, "Message", MessageDialog.NONE, new
 > > String[]{"Yes",
 > >> > "No"}, 0);
 > >> > return md.open() == 0;
 > >> >
 > >> > Unfortunately I can't think of any other workarounds that you can use
 > >> > without the need to change your code.
 > >> > Thanks.
 > >> >
 > >> > ---------------------------------------------------
 > >> > "Stephan Lips" <stephan.lips@xxxxxxxx> wrote in message
 > >> > news:dru1sg$e92$1@xxxxxxxxe.org...
 > >> >
 > >> >  Greetings,
 > >> >
 > >> >  we use using AGR/TPTP 4.1 in Eclipse 3.1.  A scenario I am
 automating
 > >> >  involves a simple confirmation dialog that is invoked by the plugin
 > > under
 > >> >  test as follows
 > >> >      MessageBox replicate = new MessageBox(getShell(), SWT.YES |
 > > SWT.NO);
 > >> >      replicate.setMessage(REP_MSG_1);
 > >> >      replicate.setText(REP_MSG_2);
 > >> >      return replicate.open() == SWT.YES;
 > >> >  When recording the scenario, AGR fails to recognize the replicate
 > >> >  dialog/record any interaction with it, subsequent test execution
 fails
 > >> > with
 > >> >  the message 'Timeout occured [...] This is likely caused by the
 > > presence
 > >> >  of an unexpected dialog'.
 > >> >
 > >> >  Is the SWT MessageBox a 'native' dialog as described in the AGR
 > >> > manual,
 > >> >  section 1.2 'Known Limitations and Workarounds', and/or is there any
 > >> >  workaround?  I would like to think that simple yes/no confirmation
 > >> > dialogs
 > >> >  such as the one I am looking at are a pretty common occurence and
 > >> > there
 > >> > is
 > >> >
 > >> >            away to make AGR work with it.
 > >> >
 > >> > Thanks much for any insight!
 > >> >
 > >> > - Stephan
 > >> >
 > >> >
 > >> >
 > >> > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 > >> > news:dtki93$ktc$1@utils.eclipse.org...
 > >> >> Hi All,
 > >> >>
 > >> >> I am encoutering problems when playing back my recorded Test Cases.
 > >> >>
 > >> >> I am going through a wizard in one of our plug-ins and the last
 dialog
 > >> >> box
 > >> >> asks if you want to build the imported project now.  When I record
 it
 > >> >> I
 > >> >> click yes and I can see the MakeFile evoked and displayed in the
 > > console
 > >> > as
 > >> >> it builds.  When I play it back (in both execution and in quick-run)
 > >> >> it
 > >> >> hangs on that last dialog box.  I can still see the project building
 > >> >> in
 > >> > the
 > >> >> console, but the dialog box remains.  I have build-automatically
 > >> >> turned
 > >> > off
 > >> >> and I know it is a JFace dialog box.
 > >> >>
 > >> >> I have tried this on both TPTP 4.2 (4.2.0-200602220100) with Eclipse
 > > 3.2
 > >> > M5
 > >> >> and also with TPTP 4.1 with Eclipse 3.2 M4.
 > >> >>
 > >> >> If anyone has any suggestions I would be very grateful!
 > >> >>
 > >> >> Thanks in advance!
 > >> >>
 > >> >> Heidi
 > >> >>
 > >> >>
 > >> >>
 > >> >
 > >> >
 > >>
 > >>
 > >>
 > >
 > >
 >
 >
 |  |  |  |  | 
| Re: AGR Test Case playback problem with dialog box [message #55891 is a reply to message #55591] | Wed, 01 March 2006 10:00  |  | 
| Eclipse User  |  |  |  |  | Hi Ali 
 Thanks for the fix.  That macro works now! :D
 
 However, that was not the problem in my macro.  I was able to fix it though.
 
 Here was my macro running through a wizard of one of my company's plug-ins:
 
 <macro version="0.1" >
 <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 <command type="select" contextId="menus"
 widgetId=" org.eclipse.jface.action.ActionContributionItem#{{&P roject-Build
 Auto&matically}}-{{0.8}}{{5|7}}-{{0.6}}{{false}}-{{0 .1}}{{12}}-{{0.1}}{{Clea&n...}}-{{0.2}}{{separator}} -{{0.2}} "
 selection="false">
 <parent widgetId="project"/>
 </command>
 <command type="select" contextId="menus"
 widgetId=" org.eclipse.jface.action.ActionContributionItem#{{&F ile-&Import...}}-{{0.8}}{{0|20}}-{{0.6}}{{true}}-{{0 .1}}{{31}}-{{0.1}}{{separator}}-{{0.2}}{{Exp&ort...} }-{{0.2}} ">
 <parent widgetId="file"/>
 </command>
 <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
 <command type="item-expand"
 contextId="wizard-page/importExportPage"
 widgetId="org.eclipse.swt.widgets.Tree#1" value="false">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.ui.Other}}-{{ 1.0}} "/>
 </command>
 <command type="item-select"
 contextId="wizard-page/importExportPage"
 widgetId="org.eclipse.swt.widgets.Tree#1">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.ui.Other}}-{{ 1.0}} "/>
 </command>
 <command type="item-expand"
 contextId="wizard-page/importExportPage"
 widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.ui.Other}}-{{ 1.0}} "/>
 </command>
 <command type="item-select"
 contextId="wizard-page/importExportPage"
 widgetId="org.eclipse.swt.widgets.Tree#1">
 <item
 path=" org.eclipse.swt.widgets.TreeItem#{{com.qnx.tools.ide.package s.BSPImportWizard}}-{{1.0}} "/>
 </command>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="item-select" contextId="wizard-page/Packages"
 widgetId="org.eclipse.swt.widgets.Table#1">
 <item path="com.qnx.tools.ide.packages.core.PackageContainer0"/>
 </command>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 <command type="modify" contextId="wizard-page/WorkingSet"
 widgetId="org.eclipse.swt.widgets.Text#2">
 <![CDATA[C:/TPTPM5a/workspace]]>
 </command>
 <command type="select" contextId="wizard"
 widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
 </shell>
 ***</shell>
 ***<shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 <shell id="org.eclipse.jface.dialogs.MessageDialog" return-code="0">
 <command type="select" contextId="shell"
 widgetId="org.eclipse.swt.widgets.Button#{{0}}-{{1.0}}"/>
 </shell>
 <command type="wait"/>
 </shell>
 </macro>
 
 I removed the two lines indicated with "***", and it worked.  I don't know
 if there is or has been any issues with recording and playing back TestCases
 that go through a similar wizard.  Hopefully this can help someone running
 into a similar problem.
 
 Thanks for all the help Ali!
 
 Heidi
 
 
 "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 news:du2a7d$fum$1@utils.eclipse.org...
 > The problem is caused because the recorder not only records your File >
 > Close selection, but it also records a close-workbenchpart command.
 > Here's a version of your macro that will work:
 >
 > <macro version="0.1" >
 >   <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 >      <command type="select" contextId="menus"
 > widgetId=" org.eclipse.ui.actions.NewWizardMenu#{{&File-&am p;New	Alt+
 >  Shift+N-P&roject...}}-{{0.8}}{{0|0|0}}-{{0.6}}{{true }}-{{0.1}}{{5}}-{{0.
 > 1}}{{first}}-{{0.2}}{{separator}}-{{0.2}}">
 >         <parent widgetId="file"/>
 >         <parent widgetId="new"/>
 >      </command>
 >      <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
 >         <command type="item-select"
 > contextId="wizard-page/newWizardSelectionPage"
 > widgetId="org.eclipse.swt.widgets.Tree#1">
 >            <item
 > path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.pde.ui.NewPro jectWizard
 > }}-{{1.0}}"/>
 >         </command>
 >         <command type="focus"
 > contextId="wizard-page/newWizardSelectionPage"
 > widgetId="org.eclipse.swt.widgets.Tree#1"/>
 >         <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >         <command type="modify" contextId="wizard-page/main"
 > widgetId="org.eclipse.swt.widgets.Text#1">
 >         <![CDATA[test]]>
 >         </command>
 >         <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >         <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >         <command type="select" contextId="wizard"
 > widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
 >         <shell id="org.eclipse.jface.dialogs.MessageDialogWithToggle"
 > return-code="2">
 >            <command type="select" contextId="shell"
 > widgetId="org.eclipse.swt.widgets.Button#{{2}}-{{1.0}}"/>
 >         </shell>
 >         <command type="wait"/>
 >      </shell>
 >      <command type="wait"/>
 >      <command type="modify"
 > contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF "
 > widgetId="org.eclipse.swt.widgets.Text#5">
 >      <![CDATA[gdgd]]>
 >      </command>
 >      <command type="wait" time-to-wait="1000"/>
 >      <command type="select" contextId="menus"
 > widgetId=" org.eclipse.jface.action.ActionContributionItem#{{&F ile-&C
 >  lose	Ctrl+W}}-{{0.8}}{{0|3}}-{{0.6}}{{false}}-{{0.1} }{{31}}-{{0.1}}{{sep
 > arator}}-{{0.2}}{{C&lose All	Ctrl+Shift+W}}-{{0.2}}">
 >         <parent widgetId="file"/>
 >      </command>
 >      <shell id="org.eclipse.jface.dialogs.MessageDialog" return-code="1">
 >         <command type="select" contextId="shell"
 > widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 >      </shell>
 >   </shell>
 > </macro>
 >
 >
 > I have re-opened defect
 > https://bugs.eclipse.org/bugs/show_bug.cgi?id=110810
 > to try and fix this.
 >
 >
 > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 > news:dtvab4$r8u$1@utils.eclipse.org...
 >> This is my macro for testing the MessageDialog.  It does not have any
 >> dependencies, so it should run it as is.
 >> I asked my co-worker to test this macro, and he was also not able to
 > select
 >> the "No" in the save MessageDialog box.
 >>
 >> Thanks so much!
 >> Heidi
 >>
 >> <macro version="0.1" >
 >>    <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 >>       <command type="select" contextId="menus"
 >>
 > widgetId=" org.eclipse.ui.actions.NewWizardMenu#{{&File-&am p;New	Alt+
 >  Shift+N-P&roject...}}-{{0.8}}{{0|0|0}}-{{0.6}}{{true }}-{{0.1}}{{5}}-{{0.
 > 1}}{{first}}-{{0.2}}{{separator}}-{{0.2}}">
 >>          <parent widgetId="file"/>
 >>          <parent widgetId="new"/>
 >>       </command>
 >>       <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
 >>          <command type="item-select"
 >> contextId="wizard-page/newWizardSelectionPage"
 >> widgetId="org.eclipse.swt.widgets.Tree#1">
 >>             <item
 >>
 > path=" org.eclipse.swt.widgets.TreeItem#{{org.eclipse.pde.ui.NewPro jectWizard
 > }}-{{1.0}}"/>
 >>          </command>
 >>          <command type="focus"
 >> contextId="wizard-page/newWizardSelectionPage"
 >> widgetId="org.eclipse.swt.widgets.Tree#1"/>
 >>          <command type="select" contextId="wizard"
 >> widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >>          <command type="modify" contextId="wizard-page/main"
 >> widgetId="org.eclipse.swt.widgets.Text#1">
 >>          <![CDATA[test]]>
 >>          </command>
 >>          <command type="select" contextId="wizard"
 >> widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >>          <command type="select" contextId="wizard"
 >> widgetId="org.eclipse.swt.widgets.Button#{{15}}-{{1.0}}"/>
 >>          <command type="select" contextId="wizard"
 >> widgetId="org.eclipse.swt.widgets.Button#{{16}}-{{1.0}}"/>
 >>          <shell id="org.eclipse.jface.dialogs.MessageDialogWithToggle"
 >> return-code="2">
 >>             <command type="select" contextId="shell"
 >> widgetId="org.eclipse.swt.widgets.Button#{{2}}-{{1.0}}"/>
 >>          </shell>
 >>          <command type="wait"/>
 >>       </shell>
 >>       <command type="wait"/>
 >>       <command type="modify"
 >> contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF "
 >> widgetId="org.eclipse.swt.widgets.Text#5">
 >>       <![CDATA[gdgd]]>
 >>       </command>
 >>   <command type="wait" time-to-wait="5000"/>
 >>       <command type="select" contextId="menus"
 >>
 > widgetId=" org.eclipse.jface.action.ActionContributionItem#{{&F ile-&C
 >  lose	Ctrl+W}}-{{0.8}}{{0|3}}-{{0.6}}{{false}}-{{0.1} }{{31}}-{{0.1}}{{sep
 > arator}}-{{0.2}}{{C&lose
 >> All	Ctrl+Shift+W}}-{{0.2}}">
 >>          <parent widgetId="file"/>
 >>       </command>
 >>    <command type="wait" time-to-wait="5000"/>
 >>       <command type="close-workbenchpart" contextId="editor"
 >> widgetId="org.eclipse.pde.ui.manifestEditor/MANIFEST.MF"/>
 >>       <shell id="org.eclipse.jface.dialogs.MessageDialog"
 >> return-code="1">
 >>          <command type="select" contextId="shell"
 >> widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 >>       </shell>
 >>    </shell>
 >> </macro>
 >>
 >>
 >> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 >> news:dto17p$nal$1@utils.eclipse.org...
 >> > Good to hear that it's recorded.  Can you post your macro to this
 > thread?
 >> > I
 >> > just tested this with Feb 22nd driver and it worked fine when I
 > attempted
 >> > to
 >> > close a *text* file that was marked dirty.  It didn't have a problem
 >> > invoking the "no" button in the message dialog that prompts the user to
 >> > save.
 >> >
 >> > Place a <command type="wait" time-to-wait="5000"/> just before the
 >> > close-workbenchpart command to ensure that the editor is marked dirty.
 > I
 >> > should say that there is a little catch if you are testing this with a
 >> > Java
 >> > file.  The Eclipse Java editor will only expand the import clause after
 >> > the
 >> > first modify.  Repeating the modify command will fix this.  This of
 > course
 >> > shouldn't be a problem if you are attempting to edit a text file.
 >> >
 >> > Here's the macro for editing a text file and clicking no when prompted
 > to
 >> > save:
 >> >
 >> > <macro version="0.1" >
 >> >   <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="-1">
 >> >      <command type="item-select"
 >> > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 >> > widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 >> >         <item
 >> >
 > path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 >> > -{{1.0}}"/>
 >> >      </command>
 >> >      <command type="focus"
 >> > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 >> > widgetId="org.eclipse.swt.widgets.Composite#1"/>
 >> >      <command type="default-select"
 >> > contextId="view/org.eclipse.jdt.ui.PackageExplorer"
 >> > widgetId="org.eclipse.swt.widgets.Tree#{{/}}-{{1.0}}">
 >> >         <item
 >> >
 > path=" org.eclipse.swt.widgets.TreeItem#{{/Plugin/test-resources/my file.txt}}
 >> > -{{1.0}}"/>
 >> >      </command>
 >> >      <command type="wait"/>
 >> >      <command type="modify"
 >> > contextId="editor/org.eclipse.ui.DefaultTextEditor/myfile.txt "
 >> > widgetId="org.eclipse.swt.custom.StyledText#1">
 >> >      <![CDATA[blah]]>
 >> >      </command>
 >> >      <command type="close-workbenchpart" contextId="editor"
 >> > widgetId="org.eclipse.ui.DefaultTextEditor/myfile.txt"/>
 >> >      <shell id="org.eclipse.jface.dialogs.MessageDialog"
 > return-code="1">
 >> >         <command type="select" contextId="shell"
 >> > widgetId="org.eclipse.swt.widgets.Button#{{1}}-{{1.0}}"/>
 >> >      </shell>
 >> >   </shell>
 >> > </macro>
 >> >
 >> >
 >> >
 >> >
 >> > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 >> > news:dtn93n$stl$1@utils.eclipse.org...
 >> >> Hi Ali,
 >> >>
 >> >> Thanks for helping me out.
 >> >>
 >> >> The dialog is an "org.eclipse.jface.dialogs.MessageDialog".  I also
 > found
 >> >> another dialog box that is of this type and it also behaves in this
 >> >> manner
 >> >> during playback. (the one that comes up when you try to close a file
 > that
 >> >> hasn't been saved yet)
 >> >>
 >> >> The information is being recorded in the macro.  Perhaps the problem
 > lies
 >> >> within the playback.
 >> >>
 >> >> Heidi
 >> >>
 >> >> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
 >> >> news:dtlbut$sl8$1@utils.eclipse.org...
 >> >> > Is the dialog org.eclipse.jface.dialogs.MessageDialog?  If so, then
 > it
 >> >> > should be able to record it.  I have tested this out before.  I know
 >> > that
 >> >> > dialogs that are of type org.eclipse.swt.widgets.MessageBox won't be
 >> >> > recorded - see the post below:
 >> >> >
 >> >> >
 >> >>
 >>  ------------------------------------------------------------ ------------
 >> >> > Hi Stephan,
 >> >> >
 >> >> > Yes, you're right.  The MessageBox is a native dialog, but
 >> >> > MessageDialog
 >> >> > isn't.
 >> >> > You can use a message dialog as follows:
 >> >> >
 >> >> > MessageDialog md = new MessageDialog
 >> >> >
 >> >
 >  (HelloWorldPlugin.getDefault().getWorkbench().getActiveWorkb enchWindow().get
 >> >> > Shell(), "Title", null, "Message", MessageDialog.NONE, new
 >> > String[]{"Yes",
 >> >> > "No"}, 0);
 >> >> > return md.open() == 0;
 >> >> >
 >> >> > Unfortunately I can't think of any other workarounds that you can
 >> >> > use
 >> >> > without the need to change your code.
 >> >> > Thanks.
 >> >> >
 >> >> > ---------------------------------------------------
 >> >> > "Stephan Lips" <stephan.lips@xxxxxxxx> wrote in message
 >> >> > news:dru1sg$e92$1@xxxxxxxxe.org...
 >> >> >
 >> >> >  Greetings,
 >> >> >
 >> >> >  we use using AGR/TPTP 4.1 in Eclipse 3.1.  A scenario I am
 > automating
 >> >> >  involves a simple confirmation dialog that is invoked by the plugin
 >> > under
 >> >> >  test as follows
 >> >> >      MessageBox replicate = new MessageBox(getShell(), SWT.YES |
 >> > SWT.NO);
 >> >> >      replicate.setMessage(REP_MSG_1);
 >> >> >      replicate.setText(REP_MSG_2);
 >> >> >      return replicate.open() == SWT.YES;
 >> >> >  When recording the scenario, AGR fails to recognize the replicate
 >> >> >  dialog/record any interaction with it, subsequent test execution
 > fails
 >> >> > with
 >> >> >  the message 'Timeout occured [...] This is likely caused by the
 >> > presence
 >> >> >  of an unexpected dialog'.
 >> >> >
 >> >> >  Is the SWT MessageBox a 'native' dialog as described in the AGR
 >> >> > manual,
 >> >> >  section 1.2 'Known Limitations and Workarounds', and/or is there
 >> >> > any
 >> >> >  workaround?  I would like to think that simple yes/no confirmation
 >> >> > dialogs
 >> >> >  such as the one I am looking at are a pretty common occurence and
 >> >> > there
 >> >> > is
 >> >> >
 >> >> >            away to make AGR work with it.
 >> >> >
 >> >> > Thanks much for any insight!
 >> >> >
 >> >> > - Stephan
 >> >> >
 >> >> >
 >> >> >
 >> >> > "Heidi Gumpert" <hgumpert@qnx.com> wrote in message
 >> >> > news:dtki93$ktc$1@utils.eclipse.org...
 >> >> >> Hi All,
 >> >> >>
 >> >> >> I am encoutering problems when playing back my recorded Test Cases.
 >> >> >>
 >> >> >> I am going through a wizard in one of our plug-ins and the last
 > dialog
 >> >> >> box
 >> >> >> asks if you want to build the imported project now.  When I record
 > it
 >> >> >> I
 >> >> >> click yes and I can see the MakeFile evoked and displayed in the
 >> > console
 >> >> > as
 >> >> >> it builds.  When I play it back (in both execution and in
 >> >> >> quick-run)
 >> >> >> it
 >> >> >> hangs on that last dialog box.  I can still see the project
 >> >> >> building
 >> >> >> in
 >> >> > the
 >> >> >> console, but the dialog box remains.  I have build-automatically
 >> >> >> turned
 >> >> > off
 >> >> >> and I know it is a JFace dialog box.
 >> >> >>
 >> >> >> I have tried this on both TPTP 4.2 (4.2.0-200602220100) with
 >> >> >> Eclipse
 >> > 3.2
 >> >> > M5
 >> >> >> and also with TPTP 4.1 with Eclipse 3.2 M4.
 >> >> >>
 >> >> >> If anyone has any suggestions I would be very grateful!
 >> >> >>
 >> >> >> Thanks in advance!
 >> >> >>
 >> >> >> Heidi
 >> >> >>
 >> >> >>
 >> >> >>
 >> >> >
 >> >> >
 >> >>
 >> >>
 >> >>
 >> >
 >> >
 >>
 >>
 >
 >
 |  |  |  | 
 
 
 Current Time: Thu Oct 30 21:49:24 EDT 2025 
 Powered by FUDForum . Page generated in 0.32964 seconds |