DZone
Java Zone
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
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Using SWTBot as script while developing RCP app

Using SWTBot as script while developing RCP app

Ankur Sharma user avatar by
Ankur Sharma
·
Jun. 13, 11 · Java Zone · Interview
Like (0)
Save
Tweet
4.28K Views

Join the DZone community and get the full member experience.

Join For Free

SWTBot is a great tool for writing UI tests. However, you can also use it as script to automate your clicks while developing UI.

Use Case

Suppose we are developing a wizard and we are designing the UI on third page. Now each time we will have to launch our application and then invoke the wizard. Provide template info for first two pages to reach the page where we are actually working currently. While designing UI we do these steps a number of times

You can use SWTBot to automate these clicks. The idea is simple. Write an SWTBot script for the clicks to be automated, invoke it using Startup extension.

How to do it?

1. Add SWTBot to Target Platform

i) Edit the target platform and add a new 'Software Site' location.

ii) Provide the URL http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site  (see http://www.eclipse.org/swtbot/downloads.php for relevant url for your Eclipse version).

iii) Select 'SWTBot Eclipse features'.

2) Add the SWTBot script using Startup extension

i) Create a dummy plug-in

ii) Add the 'org.eclipse.ui.startup' extension and create the class that will get invoked by it

iii) Add your SWTBot script to this class created above.

iv) You will have to add the dependency to 'org.eclipse.swtbot.eclipse.finder' for the SWTBot to compile.

v) Include this plug-in and the SWTBot plug-ins from the target to your launch configuration.

How this works?

The 'startup' extension makes the SWTBot script run when your application is launched. Adding the SWTBot to launch configuration will ensure it will be able to run when launched.

 From http://blog.ankursharma.org/2011/06/using-swtbot-as-script-while-developing.html

Rich client platform app

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Progressive Delivery With Argo Rollouts: Blue-Green Deployment
  • Demystifying Cloud-Native Data Management: Layers of Operation
  • Data Mesh — Graduating Your Data to Next Level
  • How Java Apps Litter Beyond the Heap

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • 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:

DZone.com is powered by 

AnswerHub logo