- Code: Select all
//open the dialog
//create the expected String list
//get expected text from the list
WidgetLocator myLocator = new SWTWidgetLocator(Label.class, expectedText);
System.out.println("Found widget: "+ expectedText);
System.out.println("Cannot find widget: "+ expectedText);
It works properly when the dialog has the expected labels, but if an expected label does not exist, the dialog is closed after the WidgetSearchException expection occurs. As a result, the rest of the labels cannot be checked. I would like to know why the dialog is closed when the find method throws an exception.