Home » Archived » Test and Performance Tools Platform (TPTP) » Using wait command in AGR script
| |
Re: Using wait command in AGR script [message #126077 is a reply to message #125948] |
Tue, 11 March 2008 17:07 |
Pushparaj Messages: 62 Registered: July 2009 |
Member |
|
|
Hi,
In our application we are having option to create/build the projects which
contains our own project natures. For building we are using eclipse's
project -> build menu. Our builder class is extending
IncrementalProjectBuilder. we has overwriten the build method like this,
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException {
AntRunner ant = new AntRunner();
try {
ant.setCustomClasspath(getClassPathURL());
ant.addBuildLogger(MyBuilderLogger.class.getName());
} catch (Exception e) {
ant.addBuildLogger("org.apache.tools.ant.DefaultLogger");
}
StringBuffer buff=""
.........
.........
ant.setBuildFileLocation(project.getLocation().append("build.xml ")
.toOSString());
ant.setArguments(buff.toString());
ant.setMessageOutputLevel(org.apache.tools.ant.Project.MSG_I NFO);
AntBuildThread thread = new AntBuildThread(ant, project);
Display.getDefault().syncExec(thread);
}
class AntBuildThread implements Runnable {
public void run() {
............
............
try {
ProgressMonitorDialog pmDialog = null;
pmDialog = new ProgressMonitorDialog(Display.getDefault()
.getActiveShell());
pmDialog.run(true, true, new RunnableCode(ant, project));
} catch (InterruptedException ie) {
ie.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}
class RunnableCode implements IRunnableWithProgress, Runnable {
..............
..............
..............
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
try {
if (monitor.isCanceled()) {
monitor.done();
return;
}
monitor.beginTask("Building source code for : "
+ project.getName(), IProgressMonitor.UNKNOWN);
ant.run(monitor);
} catch (Exception e) {
e.printStackTrace();
}
}
}
While recording AGR script i captured the following events,
1. I select one of the project(SampleModel) in the workspace
2. I click project->build menu. so the build process is started and all
the ouput messages are displayed in the console view. finally 'BUILD
SUCCESSFUL/BUILD FAILED' is displayed in the console(normally it take more
than one minute to complete the build process).
3. After the completion of build action, I insert the verification
hook(verifyResult). In the verification method i written the code to
verify the BUILD SUCCESSFUL/BUILD FAILED message in console view.
While running the AGR script, (1)It selects the project, (2) It click the
project -> build menu. then immediately it goes to the verification
method(3).
At that time my console view is empty So i am not able to verify the
SUCCESSFUL/FAILED messages.
This is my AGR script
<command descriptive="SampleModel" type="item-select"
resolverId="org.eclipse.tptp.test.auto.gui.adaptive"
contextId="view/com.clovis.cw.workspace.clovisWorkspaceView "
widgetId="{{/}}-{{1.0}}">
<item path="{{/SampleModel}}-{{1.0}}"
resolverId="org.eclipse.tptp.test.auto.gui.adaptive"/>
</command>
<command descriptive="Build Project" type="select"
resolverId="org.eclipse.tptp.test.auto.gui.nontrivial" contextId="menus"
widgetId="{{Project-Build Project}}-{{1.0}}"/>
<command descriptive="SampleModel" type="item-select"
resolverId="org.eclipse.tptp.test.auto.gui.adaptive"
contextId="view/com.clovis.cw.workspace.clovisWorkspaceView "
widgetId="{{/}}-{{1.0}}">
<item path="{{/SampleModel}}-{{1.0}}"
resolverId="org.eclipse.tptp.test.auto.gui.adaptive"/>
</command>
<command type="verification"
contextId="view/org.eclipse.ui.console.ConsoleView"
location="/IDETestContainer/src"
resource="automation.verifications.TestVerification"
hook="verifyResult:Qorg.eclipse.ui.IViewPart;"/>
Thanks,
Pushparaj
|
|
| | |
Re: Using wait command in AGR script [message #126446 is a reply to message #126155] |
Sun, 16 March 2008 10:14 |
Jimmy Jin Messages: 32 Registered: July 2009 |
Member |
|
|
Hello, Pushparaj,
I guess that this is a problem of AGR, that maybe the default timeout
for a command is not longer then the time your set for the wait command.
But I need to double check the source code to confirm this.
If it is a problem, I will try to think about how to fix it.
Maybe you can try to break the wait command into several ones, so that
each of time will not be waiting for so long?
Jimmy Jin
Pushparaj wrote:
> Hi Jimmy Jin,
> I am getting the following error message if i am using wait command,
>
> org.eclipse.core.runtime.CoreException
> A time-out occurred while running command MacroCommand [wait, line
> 105]. This is likely caused by the presence of an unexpected dialog or
> the absence of an expected dialog.
> org.eclipse.core.runtime.CoreException: A time-out occurred while
> running command MacroCommand [wait, line 105]. This is likely caused by
> the presence of an unexpected dialog or the absence of an expected dialog.
> at
> org.eclipse.tptp.test.auto.gui.internal.commands.MacroComman dShell$1$WakeUpOperaion.run(MacroCommandShell.java:929)
>
> at org.eclipse.swt.widgets.Display.timerProc(Display.java:3603)
> at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Na tive
> Method)
>
>
> I am using the wait command like this
>
> <command type="wait" time-to-wait="120000"/>
>
> I am expecting this command will wait for 2 minutes. But it is waiting
> for only 25 seconds after that it is comming out.
>
> then i tied with wait command like this
>
> <command type="wait"/>
>
> But i am getting the same result.
>
>
> Thanks,
> Pushparaj
>
|
|
|
Re: Using wait command in AGR script [message #126549 is a reply to message #126155] |
Mon, 17 March 2008 08:36 |
Jimmy Jin Messages: 32 Registered: July 2009 |
Member |
|
|
Hello, Pushparaj,
Just find that in the behavior tab of the test suite, you can set the
timeout for each invocation of test case. You can try to give a big
timeout for the invocation of test case which contains the long wait
command.
In current AGR, no matter the command is a "wait" or others, the timeout
are all the same.
Jimmy Jin
Pushparaj wrote:
> Hi Jimmy Jin,
> I am getting the following error message if i am using wait command,
> org.eclipse.core.runtime.CoreException
> A time-out occurred while running command MacroCommand [wait, line 105].
> This is likely caused by the presence of an unexpected dialog or the
> absence of an expected dialog.
> org.eclipse.core.runtime.CoreException: A time-out occurred while running
> command MacroCommand [wait, line 105]. This is likely caused by the
> presence of an unexpected dialog or the absence of an expected dialog.
> at
>
org.eclipse.tptp.test.auto.gui.internal.commands.MacroComman dShell$1$WakeUpOperaion.run(MacroCommandShell.java:929)
> at org.eclipse.swt.widgets.Display.timerProc(Display.java:3603)
> at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Na tive
> Method)
> I am using the wait command like this
> <command type="wait" time-to-wait="120000"/>
> I am expecting this command will wait for 2 minutes. But it is waiting for
> only 25 seconds after that it is comming out.
> then i tied with wait command like this
> <command type="wait"/>
> But i am getting the same result.
> Thanks,
> Pushparaj
|
|
| |
Re: Using wait command in AGR script [message #126891 is a reply to message #126603] |
Wed, 19 March 2008 10:02 |
Jimmy Jin Messages: 32 Registered: July 2009 |
Member |
|
|
Hi, Pushparaj,
For the time-outs in behavior tab, you can see
http://www.eclipse.org/tptp/test/documents/userguides/auto-g ui-images-4-3-0/behaviour-pane-4-3-0.png.
It's at the right bottom corner, just above the User Input.
I also think, at least for the "wait" command, if the time-to-wait is
specified, then within this period of time, this command should not
timeout. This can be a bug or an enhancement. But even we can get a fix
for it, it will not be available on 4.3.x version, which you are using now
(unless you apply the patch and recreate the plug-in yourself). So I
suggest you split the "wait" command into several ones, with each of them
not longer than 30s. This maybe can help to workaround this issue.
Regards,
Jimmy Jin
Pushparaj wrote:
> Hi Jimmy Jin,
> In my test script i don't want to specify the time-out for all the
> commands. I want to specify some specific commands which will take more
> time to complete. Also i don't know how much time it will take sometimes
> it takes 2 minutes sometimes more than 3 or 4 minutes. So i can't specify
> the exact time-out.
> Also i am not able to find out the place to specify the time-outs in the
> behavior tab.
> Is it available in TPTP4.3?
> Thanks,
> Pushparaj.
|
|
| |
Goto Forum:
Current Time: Thu Sep 26 15:48:52 GMT 2024
Powered by FUDForum. Page generated in 0.04669 seconds
|