Operation timed out with Progress Information

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Operation timed out with Progress Information

Postby clement » Tue Nov 03, 2009 9:32 pm

I have a Progress Information dialog box to do a Job in our application. In WindowTester, while trying to wait/assert for Shell with the Title Progress Information Dialog box, i am getting TimeOut exception. Is it the write way by Checing the shell with the title "Progress Information" to asser that dialog? or other ways are possible?

Code: Select all
ui.wait(new ShellShowingCondition("Progress Information"));
// or
ui.assertThat(new ShellShowingCondition("Progress Information"));
Clement Jebakumar
clement
 
Posts: 7
Joined: Tue Nov 03, 2009 9:11 pm
Location: Coimbatore, India

Re: Operation timed out with Progress Information

Postby Phil Quitslund » Wed Nov 04, 2009 9:29 am

Can you confirm (visually) that the progress dialog is indeed popping up before the test times out? If it is, there is also a race condition: if the dialog shows and closes quickly, it might not be there by the time you get to your wait/assert.

As for the "right way" to do it, what exactly are you trying to test? Are you trying to ensure that a certain action causes a Job to get scheduled in Eclipse? If this is the case you could interact with the Job Manager directly. Or are you trying to ensure that your action uses the progress service? Or are you simply trying to ensure that a progress dialog pops up?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Operation timed out with Progress Information

Postby clement » Wed Nov 04, 2009 7:39 pm

I can see the progress bar poping up. It is visible nearly some 8-10 secs. I like to ensure that the Action is using Progress service.
Clement Jebakumar
clement
 
Posts: 7
Joined: Tue Nov 03, 2009 9:11 pm
Location: Coimbatore, India

Re: Operation timed out with Progress Information

Postby clement » Thu Nov 05, 2009 12:42 am

Here i found some problem that UI execution is blocking the Test Thread.

Code: Select all
long startTime = System.currentTimeMillis();
ui.click(new TableItemLocator("Load Dialog", new ViewLocator("package.views.toolsview")));
System.out.println("TIME Taken" + (System.currentTimeMillis() - startTime));
ui.assertThat(new ShellShowingCondition("Progress Information"));


Output:
Code: Select all
TIME Taken: 15096
Clement Jebakumar
clement
 
Posts: 7
Joined: Tue Nov 03, 2009 9:11 pm
Location: Coimbatore, India

Re: Operation timed out with Progress Information

Postby Phil Quitslund » Thu Nov 05, 2009 8:25 am

What is the UI exception? Can you post the stack trace?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Operation timed out with Progress Information

Postby clement » Thu Nov 05, 2009 9:21 pm

Here is the Exception Trace.

Code: Select all
com.windowtester.runtime.WaitTimedOutException: Timed out waiting for condition:
toString=shell titled: Progress Information to show
class=com.windowtester.runtime.swt.condition.shell.ShellShowingCondition
   at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:776)
   at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:748)
   at com.windowtester.runtime.internal.AssertionHandler.waitFor(AssertionHandler.java:69)
   at com.windowtester.runtime.internal.AssertionHandler.assertThat(AssertionHandler.java:37)
   at com.windowtester.internal.runtime.UIContextCommon.assertThat(UIContextCommon.java:172)
   at package.uitest.UIDialogTest.testUIComponents(UIDialogTest.java:165)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at junit.framework.TestCase.runTest(TestCase.java:164)
   at junit.framework.TestCase.runBare(TestCase.java:130)
   at com.windowtester.runtime.common.UITestCaseCommon.access$0(UITestCaseCommon.java:1)
   at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:136)
   at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:157)
   at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:46)

Clement Jebakumar
clement
 
Posts: 7
Joined: Tue Nov 03, 2009 9:11 pm
Location: Coimbatore, India

Re: Operation timed out with Progress Information

Postby Phil Quitslund » Fri Nov 20, 2009 2:43 pm

Can you post the basic structure of the action implementation? Is it scheduling a job with the JobManager?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Operation timed out with Progress Information

Postby clement » Thu Nov 26, 2009 9:06 pm

Bellow is the code which shows the dialog box,

Code: Select all
    try {
      this.progressService.runInUI(this.progressService, new IRunnableWithProgress() {

        public void run(final IProgressMonitor progressMonitor) {

          progressMonitor.beginTask("imager.......", 10);
          try {
            for (int j = 10; j > 5; --j) {
              progressMonitor.subTask("starting graphics generator");

              Thread.sleep(1000);
              progressMonitor.worked(1);
            }

            int ok = GrapGenWrapper.executeBackend(generatedConfigFile);
            for (int i = 5; i > 0; --i) {
              progressMonitor.subTask("generating graphics");

              Thread.sleep(1000);
              progressMonitor.worked(2);
            }

            if (ok == 1) {
              progressMonitor.worked(10);
            }
            else if (ok >= 5) {
              ShowMessageHelper.showOkMessage(
                  MyDialogImplementation.this.parentShell,
                  Messages.configFile_error);
            }
          }
          catch (Exception e) {
            e.printStackTrace();
          }
          finally {
            progressMonitor.done();
          }
        }
      }, null);
    }
    catch (Exception e) {
      e.printStackTrace();
    }
Clement Jebakumar
clement
 
Posts: 7
Joined: Tue Nov 03, 2009 9:11 pm
Location: Coimbatore, India

Re: Operation timed out with Progress Information

Postby Phil Quitslund » Mon Nov 30, 2009 1:55 pm

Perfect. Thanks for the snippet. We'll take a look and see what we come up with.

More soon!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Operation timed out with Progress Information

Postby Phil Quitslund » Tue Dec 01, 2009 2:26 pm

So, after some time playing with this I haven't been able to come up with anything. The rub is that the UI is totally blocked during the execution of the runnable and no SWT events are generated (such as the ones accompanying shells showing or losing focus). Moreover the progress service does not appear to have any kind of API for monitoring scheduled runnables (e.g., no listeners that get notified during the flight of a runnable). If anyone has any other ideas, I'll be happy to help pursue them!

-phil
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Operation timed out with Progress Information

Postby clement » Tue Dec 01, 2009 8:05 pm

Will asserting be possible, if we are using the Progress service(Monitoring Progress View) of Eclipse?
Clement Jebakumar
clement
 
Posts: 7
Joined: Tue Nov 03, 2009 9:11 pm
Location: Coimbatore, India

Re: Operation timed out with Progress Information

Postby Phil Quitslund » Tue Dec 01, 2009 9:51 pm

I'm not sure. On the other hand, if your application uses eclipse Jobs, I'm certain we can assert that jobs have been scheduled (and/or executed). If you want me to explore progress view interactions/assertions feel free to post another snippet and I'll dig in.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Operation timed out with Progress Information

Postby clement » Wed Dec 02, 2009 10:31 pm

I finaly able to query the dialog box, by running the service as busyCursorWhile() instead of runInUI()

But i need some suggestion on how will i know the progress bar reached 100%? Is there any helper classes for it?
Clement Jebakumar
clement
 
Posts: 7
Joined: Tue Nov 03, 2009 9:11 pm
Location: Coimbatore, India

Re: Operation timed out with Progress Information

Postby Phil Quitslund » Thu Dec 03, 2009 6:48 am

Won't the dialog get dismissed when it reaches 100%? Can you simply wait for it to be dismissed? If it does not get disposed, you've got an error condition... If this doesn't work, feel free to post your modified sample snippet and we'll take a look.

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Operation timed out with Progress Information

Postby jerusalem1 » Thu Dec 03, 2009 8:10 am

If this is the case you could interact with the Job Manager directly. Or are you trying to ensure that your action uses the progress service? Or are you simply trying to ensure that a progress dialog pops up?
jerusalem1
 
Posts: 1
Joined: Thu Dec 03, 2009 8:07 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest