DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Frameworks
  4. UI Testing with Eclipse Jubula: Preparing the Test Object

UI Testing with Eclipse Jubula: Preparing the Test Object

Joachim Hofer user avatar by
Joachim Hofer
·
Jun. 12, 11 · Interview
Like (0)
Save
Tweet
Share
13.70K Views

Join the DZone community and get the full member experience.

Join For Free

Recently, Bredex created an interesting product at the Eclipse Foundation: namely, Jubula, a tool for UI testing Eclipse RCP, SWT, Swing and web applications. Basically, I guess this will become the “community edition” of GUIDancer, which is good enough for me, considering the dire need for any free UI testing tool for RCP, SWT or Swing at all.

I won’t go into comparisons with other tools in this post, but in short, imho, though there may be better tools for web testing, though there may be alternatives for Swing testing, though there may be better commercial tools for testing RCP and SWT, when you’re looking for free tools for testing RCP/SWT, I think you should start with Jubula.

Unfortunately, working with Jubula turns out to be a bit unwieldy at first. – So I’ll try to give a detailed step-by-step guide to your first GUI test automation with Jubula here, using a simple Eclipse RCP sample project as the test object.

So, let’s start with setting up the test object first: Open up Eclipse and create a new plug-in project (File/New/Project…/Plug-in Development/Plug-in Project):New Plug-in Project Wizard, Page 1

Next, tell Eclipse that it’s a rich client application:New Plug-in Project Wizard, Page 2

And finally, choose the “RCP Mail” template:New Plug-in Project Wizard, Page 3

Now, let’s see what we’ve got in our workspace:The Mail RCP project, with warnings!

Hey, wait, what’s that, warnings about raw types? – We can’t tolerate that. I’ll quickly fix these by turning the List into a List<TreeObject>:Fixing the warnings

That was easy. Actually, why do they have these warnings in their sample code at all? – Anyway, what’s next? Right, let’s try if it works:Ok, it runs

Looking good. This should be simple enough for our first steps, yet complex enough to play around a bit. – However, for exporting the application, we’re missing a product configuration (File/New/Product Configuration):Creating a product configuration

Alright, now we’re set for exporting the RCP application as Eclipse product (File/Export…/Eclipse product):Exporting the RCP product

Finally, we’re done with preparing our test object. Or are we?

Actually, we’re not, unfortunately. The reason for this is that sadly, the Eclipse JFace/SWT libraries haven’t got any easy way to access/instrument them for automation on the fly (unlike Swing).

So, Jubula has to somehow hook itself into our RCP application, and we have to help with that: Look for the archive rcp-support.zip in your Jubula installation directory and extract it into your product directory. This will add a Jubula instrumentation plugin to your product.

However, that’s not all. You’ve still got to activate that plugin, and you can do that by editing the configuration/config.ini file in your product directory. There’s a long line in that file listing the osgi.bundles, and you have to add the Jubula plugin at the end:Configuring the OSGi bundles

Phew. Now we’re really really done with preparing the test object. Of course, for real projects, you’ll probably want to automate all these preparations in your build.

Let’s start up Jubula and do some testing! – Or wait, actually, let’s do that in my next blog post. :)

 

From http://jmhofer.johoop.de/?p=97

Eclipse Testing Object (computer science) application Rich client platform Test automation Directory Standard Widget Toolkit Listing (computer)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Testing Level Dynamics: Achieving Confidence From Testing
  • gRPC on the Client Side
  • A Gentle Introduction to Kubernetes
  • Cloud Performance Engineering

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: