Do tests recorded on Windows then run on Linux?

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

Do tests recorded on Windows then run on Linux?

Postby ajbetz » Tue Feb 01, 2011 4:39 pm

Couldn't find an answer to this anywhere ... if I record my test on Windows, should I be able to run it on Linux? Currently, I am hitting this: http://forums.instantiations.com/viewtopic.php?f=5&t=5796
when I try and run my test on Linux.

I'm guessing if this is a supported use case, that there is something I need to provide in terms of the execution plug-ins. Right now, I have installed the execution plug-ins that my windows machine generated when I created a new provisioned target using the WTP target provisioner in my IDE. My guess is that the provisioner just created the windows plug-ins, and that there is a similar set of plug-ins for Linux.

Any ideas / comments?
ajbetz
 
Posts: 17
Joined: Wed Jan 05, 2011 4:10 pm
Location: Beaverton, OR

Re: Do tests recorded on Windows then run on Linux?

Postby keertip » Wed Feb 02, 2011 8:23 am

Could you describe how you are porting the test over to linux, and what you did to setup the system on linux?
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Do tests recorded on Windows then run on Linux?

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

Of course.

My process is a little bit different than invoking the tests like a JUnit test using PDE. As I have described in some other threads, my RCP application has very tight (ie, not going to change) restrictions on acceptable and consumable command line parameters that are passed into the application. I first noticed this when I was testing the product in my IDE, and my application code was rejecting -version and -port parameters (and the others) when trying to run a PDE test. Therefore, I have written a "test runner" utility that is designed to accept in the name of my test plug-in (ie, a plug-in that contains my recorded WindowTester Pro JUnit classes) and name of the class contained in this plug-in that I want to invoke, and then launch them. My plug-in is an extension of the org.eclipse.ui.startup extension point, and so the test runner utility code is invoked immediately after my workbench is initialized. The code parses for custom vmarg parameters that I have passed in, and then launches the test using the junit.framework package.

I first packaged up the WindowTester pro execution environment plug-ins (minus the GEF ones) that were designed to run on Eclipse 3.6 applications:

  • com.windowtester.runtime
  • com.windowtester.runtime
  • com.windowtester.swing.runtime
  • com.windowteser.swt.runtime.win32.win32.x86
  • com.windowtester.swt.runtime
  • All 5 of the com.instantiations.* plugins

I then packaged up my test runner plug-in (along with some other plug-ins that are required by the com.windowtester.usageprofiler plug-in that are missing in my application under test):

  • my.custom.plugin (the test runner that I wrote)
  • org.hamcrest.core
  • org.junit
  • org.eclipse.core.filesystem
  • org.eclipse.core.resources

Both of these are installed in a deployed RCP application by placing the plug-ins in a separate folder (ie, c:\extsite), and then editing the eclipse/configuration/org.eclipse.update/platform.xml file to include an additional site, pointing to this external directory. I confirmed using the OSGi framework console that these plug-ins are visible in the RCP application, and that their status is <<resolved>> instead of just <<installed>> (According to eclipse.org, the "installed" state just means that OSGi is aware of a bundle, but that the bundle has missing dependencies, or that something is missing).

I then install my plug-in containing my window tester pro tests via the same method as the other collection of plug-ins.

Once everything is installed, I then invoke my RCP application, and pass in the custom -vmargs parameters that my test runner utility is searching for. My code is then launched after my RCP workbench is visible on the desktop.

This process seems to work great on Windows: my test is playable, and the report file that I generate contains a complete record of actions that are performed (including Exceptions if an exception is thrown during the execution of the test). However, this process does not seem to work in Linux.

I am suspecting that the org.windowtester.swt.runtime.* plug-in that is suited for the win32-win32-x86 environment needs to be replaced with its Linux-equivalent ...
ajbetz
 
Posts: 17
Joined: Wed Jan 05, 2011 4:10 pm
Location: Beaverton, OR

Re: Do tests recorded on Windows then run on Linux?

Postby keertip » Fri Feb 04, 2011 8:25 am

Yes, that is correct. The runtime plugins are specific to the operating system. So you do need the linux specific one when you run the tests under linux.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Do tests recorded on Windows then run on Linux?

Postby ajbetz » Fri Feb 04, 2011 8:39 am

OK, that is kind of what I suspected was happening- good to know for certain! :)

Is there a download link somewhere where I can just get this specific plug-in, or would I need to install WTP on a Linux-based Eclipse instance, and then use the WTP provisioning wizard to generate the runtime plug-ins?
ajbetz
 
Posts: 17
Joined: Wed Jan 05, 2011 4:10 pm
Location: Beaverton, OR

Re: Do tests recorded on Windows then run on Linux?

Postby ajbetz » Fri Feb 04, 2011 8:53 am

NVM, I found the JAR URL's from walking the runtime feature metadata to grab all of the swt.runtime libraries I would need for the platforms I want my test to execute on.

Thanks for the tip!
ajbetz
 
Posts: 17
Joined: Wed Jan 05, 2011 4:10 pm
Location: Beaverton, OR

Re: Do tests recorded on Windows then run on Linux?

Postby keertip » Mon Feb 07, 2011 8:27 am

Glad to know that you got it all setup!
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest

cron