Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot access confusion...
SWTBot access confusion... [message #839295] Sun, 08 April 2012 08:44
joseph reddington is currently offline joseph reddington
Messages: 15
Registered: January 2012
Junior Member
So I'm testing an eclipse plugin with SWTbot and I'm not getting the result I'm expect - when I cut the test down it turns out that the problem isn't with the bot it's with some code that I've copied accross from another part of the program (where it was fully functional)

The following code...

 @RunWith(SWTBotJunit4ClassRunner.class)
    public class Tests {
    
    	private static SWTWorkbenchBot bot;
    
    	@BeforeClass
    	public static void beforeClass() throws Exception {
    		bot = new SWTWorkbenchBot();
    		bot.viewByTitle("Welcome").close();
    	}
    
        @Test
    	public  void maybeThisWillWork(){
    		IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    		System.out.println("A");
    		IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
    		System.out.println("B");
    	}
    	
    	@AfterClass
    	public static void sleep() {
    		System.out.println("In the sleep function");
    		bot.sleep(10000);
    	}
    }

Gives me the output -

   A
    In the sleep function


Rather than the expected

A
    B
    In the sleep function


Any ideas?
Previous Topic:How about enhancing SWTBot to support more Nebula widgets?
Next Topic:No idea now to refer to a menu item...
Goto Forum:
  


Current Time: Sun Apr 20 18:11:13 EDT 2014

Powered by FUDForum. Page generated in 0.05231 seconds