2

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();
}
Baz
  • 36,440
  • 11
  • 68
  • 94
Marwan Jaber
  • 611
  • 11
  • 27
  • It reads like you want to do optical character recognition (OCR). This is one of the most difficult problems in computer science. http://en.wikipedia.org/wiki/Optical_character_recognition – Gilbert Le Blanc Dec 03 '13 at 13:53
  • 1
    sorry, but are you sure this is related to the topic of my question? – Marwan Jaber Dec 03 '13 at 14:01

1 Answers1

-1

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.

Andy_Li
  • 1
  • 1