I'm trying to write a SWTBot test that opens the welcome page view in eclipse and then reads/maps the content into some object (don't care if only string) so I could compare it with the expected text, I thought this is a very trivial issue and that i will find example on the internet, but I couldn't! Any help please?

@Test
public void testExpandText() throws Exception {
    bot.menu(Constants.HELP_MENU).menu(Constants.WELCOME).click();
    welcomePageView = bot.viewByTitle(Constants.WELCOME);
    //expandText();
    //assertText();
    welcomePageView.close();
}

没有正确的解决方案

其他提示

Seems the content of welcome page is a website page... Maybe it is not supported by SWTBot now.

And, if you want to see some sample test codes, you can try to open the Perspective menu using the following codes.

bot.menu("Window").menu("Open Perspective").menu("Other...").click();
bot.shell("Open Perspective").activate();
bot.table().select("Debug");
//bot.table().getTableItem(2).getText(); //Get the 2nd line text of the list. 
bot.button("OK").click();

Hope the code is useful for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top