|
|
Re: Can SWTBot be used to scrape the Console view? [message #526158 is a reply to message #526147] |
Thu, 08 April 2010 22:32  |
Eclipse User |
|
|
|
Hi Jeff,
> SWTBotStyledText styledText = new
> SWTWorkbenchBot().viewByTitle("Console").bot().styledText(); ??
yes, I was just curious about it, this works as proposed by Pascal:
public class SampleIDETest {
private SWTWorkbenchBot bot = new SWTWorkbenchBot();
@Test
public void testConsole() throws Exception {
SWTBotView consoleView = bot.viewByTitle("Console");
consoleView.show();
assertEquals("hi\n", consoleView.bot().styledText().getText());
}
}
btw: To determine the type of a widget you want to work with it's very helpful to run the
application with the SWTBot Spy plug-in. The spy plug-in view shows for the console text:
//Shell/-1//Composite/4//Composite/0//Composite/3//Composite /0//PageBook/0//StyledText/1
Greetings,
Ralf
--
http://www.ralfebert.de/blog/
http://twitter.com/ralfebert/
|
|
|
Powered by
FUDForum. Page generated in 0.05950 seconds