I am writing SWTBot test case for my Eclipse E4 application.
In by setUp() (annotated with @Before), I am opening the part using the menu. I would like to close the same in tearDown (annotated with @After).
I tried with SWTWorkbenchBot, get the active view and close it but the active view instance is null. The view is in fact view and in focus. I can see it.
The code I have tried
SWTWorkbenchBot wbBot = new SWTWorkbenchBot();
SWTBotView botView = wbBot.activeView();
botView.close();
Thanks in advance for the help.