FAQ

Can SWTBot be used to test RCP Applications?

Yes SWTBot can be used to test any kind of SWT apps -- SWT, Eclipse plugins and RCP applications.

What platforms is SWTBot tested on?

SWTBot is continuously tested on a grid of cruise servers that run windows XP/2003, linux/gtk 32 bit and 64 bit and macosx(carbon).

Why do tests run on a non-UI thread?

A lot of events that SWTBot sends to the UI are blocking. SWT dialogs are one of them. This means that functions opening dialogs, will block until the dialog closes. Since we do not want tests to block when a dialog open up, SWTBot runs in a non-UI thread, and posts events to the UI thread.

Why do I have to run tests as SWTBot tests, instead of PDE-JUnit tests?

Can I slow down the execution speed of SWTBot tests?

Yes you can! To slow down the speed of execution of SWTBot, you need to set the system property "org.eclipse.swtbot.playback.delay". This delay is in milliseconds. You can also set this property in code as follows:

// slow down tests
SWTBotPreferences.PLAYBACK_DELAY=10;// set to the default speed
SWTBotPreferences.PLAYBACK_DELAY=0;

Can I change the timeout for execution of SWTBot tests?

Yes you can! To change the timeout, you need to set the system property "org.eclipse.swtbot.search.timeout". The timeout is specified in milliseconds. You can also set this property in code as follows:

// increase timeout to 10 seconds
SWTBotPreferences.TIMEOUT=10000;// set to the default timeout of 5 seconds
SWTBotPreferences.TIMEOUT=5000;

Can I change the poll delay for evaluating conditions in SWTBot tests?

Yes you can! To change the poll delay, you need to set the system property "org.eclipse.swtbot.playback.poll.delay". The poll delay is specified in milliseconds. You can also set this property in code as follows:

// increase timeout to 1 second
SWTBotPreferences.DEFAULT_POLL_DELAY=1000;// set to the default timeout of 500ms.
SWTBotPreferences.DEFAULT_POLL_DELAY=500;