Community
Participate
Working Groups
Description copied from http://swtbot.org/bugzilla/show_bug.cgi?id=144: If a widget can?t be found for some reason a exception is raised, for example: org.eclipse.core.runtime.AssertionFailedException: assertion failed: Widget SWTBotText Text {} is not enabled. But I haven?t searched for the widget by the text attribute but by its label: ... bot.textWithLabel(?Picture location?); It would be nice if SWTBot could take this in the error message into consideration, that a widget was searched for by label. Then it is easier to identify it just by the error message. But that is of course just a ?nice to have? feature.
The SWTBot widget wrappers now have an additional constructor, that takes in a SelfDescribing that can describe the widget, it is convinient to pass in the org.hamcrest.Matcher that was used to find the widget as a SelfDescribing. This generates messages like: - SWTBotButton - (AbstractSWTBot.java:137) - Enquing event Deactivate [27]: ShellEvent{Button {*Disposed*} time=-1594706202 data=null doit=true} on (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH') - Expected widget (of type 'Button' and with mnemonic 'One' and with style 'SWT.PUSH') to be enabled.
If there's anything else you think may improve error message, please add a comment to this bug.
Hans, Ketan, Do you have anything else in mind to improve error messages, I'd like to close this bug ?
I think this is good...can always reopen or create new bug when we run into other cases. (In reply to comment #3) > Hans, Ketan, > > Do you have anything else in mind to improve error messages, I'd like to close > this bug ? >
I have nothing else in mind currently.