Twitter github

SWTBot and Eclipse Forms

When it comes to user interface testing in Eclipse, I’m a big fan of SWTBot. I had some long plane rides recently and a need to add some functionality to SWTBot so I decided to see if I could tackle an outstanding feature request in SWTBot to add Eclipse Forms support. On top of that, I also had a selfish reason to learn more about the internals of SWTBot. After forking Ketan’s copy of SWTBot on GitHub, I pushed my changes which adds an SWTFormsBot class as the primary handle to drive user interface tests.

So your test code would look something like this…

public class SWTBotImageHyperlinkTest extends AbstractSWTBotFormsTestCase {
 
	@Test
	public void findImageHyperlink() throws Exception {
                FormView view = new FormView(shell);
                SWTFormsBot = new SWTFormsBot();
		SWTBotImageHyperlink link = 
                     bot.imageHyperlink("Image link with no image");
		assertNotNull(link);
		assertEquals("Image link with no image", link.getText());
	}
 
}

We’re looking to eventually integrate this into SWTBot proper, just pay attention to this bug if you’re interested.

Enjoy.

  • vogella

    Cool stuff. You are truely fluently in all Eclipse Plugins. :-)

  • http://aniszczyk.org Chris Aniszczyk

    Thanks for the kudos Lars. The code should be in the mainline of SWTBot this week once my committer access goes through. This feature was born mostly out of doing some client work previously that required this functionality… gotta love open source.

  • vogella

    Cool stuff. You are truely fluently in all Eclipse Plugins. :-)

  • http://aniszczyk.org Chris Aniszczyk

    Thanks for the kudos Lars. The code should be in the mainline of SWTBot this week once my committer access goes through. This feature was born mostly out of doing some client work previously that required this functionality… gotta love open source.

  • http://www.amandachina.com/wholesale-sandals_c1414 wholesale sandals

    Its really very great and informative post. thanks for sharing the information.