Testing a RCP application using WindowTester

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

Testing a RCP application using WindowTester

Postby xslaugh » Mon Sep 08, 2008 12:50 pm

Hello,

I am trying to use WindowTester to test an Eclipse based RCP application. I've been able to record a test from within Eclipse, but have since been trying to get my test to run from a built version of our application, outside of Eclipse. I've been looking at the "Ant Sample - Testing a RCP App" on the WindowTester website, but haven't been able to modify it so that it launches my application and then runs my test, which I've exported into a jar file. I've changed all the values in the test.properties file to match my application and test, but whenever I try running the ant script, the application never launches, and the JUnit result web-page shows that no tests were run. Does anybody have any ideas what I'm doing wrong here?
xslaugh
 
Posts: 1
Joined: Mon Sep 08, 2008 12:45 pm

Re: Testing a RCP application using WindowTester

Postby Phil Quitslund » Tue Sep 23, 2008 7:40 pm

Are you still blocked on this? If so, you might send a mail directly to support:

wintest-support@instantiations.com

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

Re: Testing a RCP application using WindowTester

Postby nartubitak » Tue Dec 15, 2009 4:50 am

I have the similar problem.

I downloaded ContactManagerRCPExampleAnt_v1.0.0.zip. I run it successfully.

I replace the contents of application and apptests folders with my RCP application and Test (exported into a jar file)
My environment is Eclipse 3.5, java-6-sun-1.6.0.16, WindowTesterPro_v4.0.0_for_Eclipse3.5, Ubuntu 9.04
I updated the properties in test.properties file.

When I run "runTest" script, it finishes with "BUILD SUCCESSFUL" expression but it does not launch my application with the given test.
It opens browser with "Unit Test Results" page. No tests are listed in that page.
(Links to test and windowtesterruntime are done properly.)
I checked the output/(apptests-name)/test-out.txt file. Its contents is as below.
It seems that "com.windowtester.runner.application" is not found.
Is there anybody who knows how to fix that problem?
Thanx


Code: Select all
!SESSION 2009-12-15 14:43:44.819 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -noupdate formatter=com.windowtester.runtime.ant.WindowTesterXMLJUnitResultFormatter,/home/narin/Desktop/KSMAnt/cmtest/output/KSMPluginTest/test-result.xml -application com.windowtester.runner.application -testPluginName KSMPluginTest -classname ksmplugintest.AllTests -verbose -testApplication KSMPlugin.application
Command-line arguments:  -clean -noupdate -dev bin -data /home/narin/Desktop/KSMAnt/cmtest/scratch/KSMPluginTest/workspace formatter=com.windowtester.runtime.ant.WindowTesterXMLJUnitResultFormatter,/home/narin/Desktop/KSMAnt/cmtest/output/KSMPluginTest/test-result.xml -application com.windowtester.runner.application -testPluginName KSMPluginTest -classname ksmplugintest.AllTests -verbose -consolelog -testApplication KSMPlugin.application

!ENTRY org.eclipse.osgi 4 0 2009-12-15 14:43:46.017
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "com.windowtester.runner.application" could not be found in the registry. The applications available are: ImageMarking.application, KSMPlugin.application, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.artifact.repository.mirrorApplication, org.eclipse.equinox.p2.metadata.repository.mirrorApplication.
   at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
   at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
   at org.eclipse.core.launcher.Main.main(Main.java:34)
nartubitak
 
Posts: 5
Joined: Tue Oct 06, 2009 12:42 am

Re: Testing a RCP application using WindowTester

Postby Phil Quitslund » Thu Dec 17, 2009 10:14 am

Thanks for your inquiry. We are in the process of updating the samples and hope to make this process much easier. We will follow up with you via the support thread you started with our support team. Once we have the issue resolved we can post a summing-up here.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Testing a RCP application using WindowTester

Postby tcourant » Thu Jun 03, 2010 10:36 pm

Hello,

i've got the same problem. I am currently evaluating WindowTester product, and i want to use it in a continuous build system like Hudson.
Can you help me with this error please ?

Thanx
Thomas COURANT.
tcourant
 
Posts: 1
Joined: Thu Jun 03, 2010 6:27 am

Re: Testing a RCP application using WindowTester

Postby keertip » Fri Jun 04, 2010 9:48 am

To run the WindowTester test for your RCP application outside of elicpse, you need to use the WindowTesterRunner product. The WindowTesterRunner is used to launch the RCP application and run the tests.

http://downloads.instantiations.com/Win ... unner.html

The download for WindowTesterRunner includes the ContactManagerRCP example with the tests, to help get you started. The documentation at

http://downloads.instantiations.com/Win ... ample.html

also has instructions on how to use WindowTesterRunner to test your RCP application.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Testing a RCP application using WindowTester

Postby yuri_ » Mon Jul 12, 2010 4:28 am

Hello. I’ve run into this problem too. When trying to run tests outside of an IDE, the Window Tester Runner fails to start with
Code: Select all
java.lang.RuntimeException: Application "com.windowtester.runner.application" could not be found in the registry”. The applications available are: …

What is more confusing, testing a simple dummy application works just fine, but a real one crashes. Does anyone know the reason behind it or at least have any suggestions of a workaround?
Thanks in advance.
yuri_
 
Posts: 2
Joined: Mon Jul 12, 2010 3:28 am

Re: Testing a RCP application using WindowTester

Postby gnebling » Mon Jul 12, 2010 1:51 pm

Yuri,

What version of WindowTester/WindowTesterRunner are you using? What version of Eclipse, Java and Operating System are you using?

Just to clarify, did you try the Contact Manager RCP example here http://downloads.instantiations.com/Win ... ample.html and it worked? When you tried your own application, you got an error, correct? I'm assuming you are running your own test and modified the Ant script to run your own application.

We can take a look at your modified Ant script and the .log file if you could send it to our Support address at wintest-support@instantiations.com.

Thanks
WT Support
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Re: Testing a RCP application using WindowTester

Postby yuri_ » Tue Jul 13, 2010 4:37 am

Yes, I tried out the Contract Manager example. It worked. Then I configured ant script to run tests on my own applications. For simple toy application everything was ok. But when I tried to run tests on the real project I had this “could not be found in the registry” issue. I checked the script and even added plug-ins and features exported via WindowTester Target Provisioner wizard. It didn’t help. I still get this:
Code: Select all
!SESSION 2010-07-13 13:45:08.189 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -noupdate formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,D:\WindowTesterRunner_3.5\output/acs_test/test-result.xml -application com.windowtester.runner.application -testPluginName WT_Tests -classname tests.Test1 -verbose -testProduct de.ims.acs.shell.product
Command-line arguments:  -clean -noupdate -dev bin -data D:\WindowTesterRunner_3.5\scratch/acs_test/workspace formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,D:\WindowTesterRunner_3.5\output/acs_test/test-result.xml -application com.windowtester.runner.application -testPluginName WT_Tests -classname tests.Test1 -verbose -consolelog -testProduct de.ims.acs.shell.product

!ENTRY org.eclipse.equinox.ds 4 0 2010-07-13 13:45:08.704
!MESSAGE
!STACK 0
org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.eclipse.equinox.internal.util.event; version="1.0.0"
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1313)
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1297)
   at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:309)
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
   at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1068)
   at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:557)
   at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
   at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
   at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:445)
   at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
   at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)

!ENTRY org.eclipse.osgi 4 0 2010-07-13 13:45:09.548
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "com.windowtester.runner.application" could not be found in the registry. The applications available are: de.ims.acs.et.client.communication.application, de.ims.acs.shell.application, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.artifact.repository.mirrorApplication, org.eclipse.equinox.p2.metadata.repository.mirrorApplication, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, org.eclipse.ui.ide.workbench.
   at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
   at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
   at org.eclipse.core.launcher.Main.main(Main.java:34)

But when I try to reproduce test result without cleaning the execution environment and redeploying application I get this:
Code: Select all
!SESSION 2010-07-13 13:48:00.501 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -noupdate formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,D:\WindowTesterRunner_3.5\output/acs_test/test-result.xml -application com.windowtester.runner.application -testPluginName WT_Tests -classname tests.Test1 -verbose -testProduct de.ims.acs.shell.product
Command-line arguments:  -noupdate -dev bin -data D:\WindowTesterRunner_3.5\scratch/acs_test/workspace formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,D:\WindowTesterRunner_3.5\output/acs_test/test-result.xml -application com.windowtester.runner.application -testPluginName WT_Tests -classname tests.Test1 -verbose -consolelog -testProduct de.ims.acs.shell.product

!ENTRY org.eclipse.osgi 4 0 2010-07-13 13:48:01.157
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "com.windowtester.runner.application" could not be found in the registry. The applications available are: de.ims.acs.et.client.communication.application, de.ims.acs.shell.application, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.artifact.repository.mirrorApplication, org.eclipse.equinox.p2.metadata.repository.mirrorApplication, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, org.eclipse.ui.ide.workbench.
   at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
   at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
   at org.eclipse.core.launcher.Main.main(Main.java:34)

As you can see, one of the exceptions is gone but the other is still intact and the test execution is blocked. Any insights?
Almost forgot, I use:
JVM 1.6.0_20
Eclipse 3.5
WindowTesterRunner_v5.1.0_for_Eclipse3.5_win32.win32.x86
yuri_
 
Posts: 2
Joined: Mon Jul 12, 2010 3:28 am

Re: Testing a RCP application using WindowTester

Postby gnebling » Tue Jul 13, 2010 10:46 am

Sounds like some plugins are missing. Did you follow the steps outlined under "Modifying the example to run tests for a different application", especially steps 1 and 2?
http://downloads.instantiations.com/Win ... ample.html

Have you tried running your tests within Eclipse using the same target platform (assuming you are using one) generated by the Target Provisioner to ensure it runs without errors. Click the Validate Plugins in the test launch configuration to see if there are plugins missing.
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Re: Testing a RCP application using WindowTester

Postby ma_ids » Wed Jul 28, 2010 6:37 am

Hi,

I assume that the problems described by yuri_ could be caused by the fact that the provided ant macros and scripts just do it the old "brute force" way when you wanted to install a new plugin in your Eclipse:
just copy and paste the plugins to the plugins folder and the features to the features folder of your eclipse installation and hope that it is running.
This way is deprecated and should not be used any more. Instead the new P2 mechanism has to be used to correctly configure your "eclipse" installation with new features and plugins. As I am new to P2 myself I can't 100% assert that it will work; this is "homework" for Instantiation. They should update their ant macros and scripts to reflect the current state of the art P2 mechanism for Eclipse 3.5 / 3.6.

I would appreciate it if anyone could try this out and modify the provided window tester runner package to use P2.

cu,
Daniel
ma_ids
 
Posts: 1
Joined: Wed Jul 28, 2010 6:21 am

Re: Testing a RCP application using WindowTester

Postby Phil Quitslund » Wed Jul 28, 2010 8:10 am

Great suggestion Daniel. I've forwarded this on to our build master and he'll take a look when he comes up for air. In the meantime, any other contributions much appreciated!

Thanks!

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

Re: Testing a RCP application using WindowTester

Postby Lukas » Mon Dec 20, 2010 6:33 pm

Hello all,

I am interesting with WindowTester, and i need some examples to run plugin tests from Ant and RCP Application from Ant.
But, the Product link to download is not available for now. Could you please share me WindowTesterExampleAnt_v1.0.0.zip and ContactManagerRCPExampleAnt_v1.0.0.zip ?

Thanks!
Lukas
Lukas
 
Posts: 1
Joined: Mon Dec 20, 2010 12:15 am

Re: Testing a RCP application using WindowTester

Postby keertip » Thu Dec 23, 2010 1:33 pm

Unfortunately, the standalone WindowTesterRunner product is no longer shipped. Will look into putting together a example of how to use with the current offerings.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Testing a RCP application using WindowTester

Postby ajbetz » Wed Feb 02, 2011 8:27 am

Just curious about the standalone test runner, as I have also been trying to work on a "test runner" of sorts (although I had a different problem in which my RCP application would reject non-application command line parameters, so my test runner needed to pass those plug-in and class name arguments as vmargs).

Is there any update on this?
ajbetz
 
Posts: 17
Joined: Wed Jan 05, 2011 4:10 pm
Location: Beaverton, OR

Next

Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest