swtbot failing when reseting workbench

I have a test like this

public class TesteSairApp extends GermantechTest {

    @Test
    public void testApp() throws Exception {
        SWTBotMenu file = bot.menu("Arquivo");
        bot.sleep(1000);

        SWTBotMenu clickSair = file.menu("Sair");
        bot.sleep(1000);

        SWTBotMenu menuClicado = clickSair.click();
        System.out.println(menuClicado);
        bot.sleep(1000);

        pass();
    }

which just quit the app. After the app quit, I got this exception: java.lang.NoClassDefFoundError: org/hamcrest/Matchers at org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.editors(SWTWorkbenchBot.java:222) at ...

If I remove the bot.resetWorkbench(); from @After in GermantehcTest, the test passes... What is wrong here?

Answers


It looks to me like a dependency issue. Did you include org.hamcrest in the manifest of your tests? If so take a look at the org.hamcrest bundle. As a guess the class 'org.hamcrest.Matchers' is missing there. Depending on the distribution of hamcrest you have chosen, this class might be missing (on purpose). Afaik it is missing in the hamcrest-core-xy.jar. You could try to add the Hamcrest additional library of matchers to your target and your manifest. If this works I would suggest to bake your own bundle of hamcrest-all, using this as a base (I did not find a hamcrest-all as a bundle as a download).


Need Your Help

WPF Datagrid using MVVM.. is two way binding to DataTable possible?

wpf datagrid mvvm datatable wpfdatagrid

I have a datagrid in my View with it's ItemSource bound to a DataTable in my ViewModel. When I update the DataTable programmatically (adding a column through a command) the changes are not populate...

Positioning views so that each one of them takes the same space

android android-layout android-linearlayout

I'm trying to a position a couple of views(let's say N) in a line, so that each one of them will take 1/N of the width of the screen. I'm aware how to achieve this using LinearLayout(layoutWeight),...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.