How to decrease warning message such as Widget is not enabled [message #1800950] |
Thu, 10 January 2019 04:50  |
Eclipse User |
|
|
|
Hi,
in my test suites I have actions such as *
bot.menu("File").menu("New").menu("GEMOC Melange Project for Sequential xDSML").click();
bot.text().setText(PROJECT_NAME);
bot.button("Next >").click();
which was actually generated from the recorder. (in the above code this a kind of "New project" wizard)
However, when running the test I get warning messages such as:
361587 [main] WARN org.eclipse.swtbot.swt.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Next >' and with style 'SWT.PUSH')
What does it really mean? (the test passes correctly ...)
(My guess is that the button takes some time to be enabled and swtbot report it and at some point, the button is enabled and the action is done ?)
How can I decrease the number of such warnings? (My build + test log is quite long and I wish to reduce warnings to significant ones)
[Updated on: Thu, 10 January 2019 04:51] by Moderator
|
|
|
|
|
Re: How to decrease warning message such as Widget is not enabled [message #1801000 is a reply to message #1800995] |
Thu, 10 January 2019 15:44  |
Eclipse User |
|
|
|
You're right about the click()
I have a similar message when calling this kind of code (sorry it's in xtend and not in java)
def void clickOnStepInto(){
val matcher = allOf(widgetOfType(typeof(ToolItem)),
anyOf(withTooltip("Step &Into (F5)"), withTooltip("Step &Into")),
withStyle(SWT.PUSH, "SWT.PUSH")
)
val btn = new SWTBotToolbarPushButton( bot.widget(matcher, 0) as ToolItem, matcher);
btn.click
}
And I know that the Step button (the one used for debug :-) ) may be disabled and then enabled later during execution.
Is there a way to write a query that waits for the button to be enabled?
Maybe the SWTBOTButton. click() should be implemented in a way where it waits by default and fails only if the button is never enabled. It should probably fail and not just report a warning in this case. (I know that extensive tests should also test clicking on disabled buttons but in most situations, we try to mimic "normal" user behavior)
|
|
|
Powered by
FUDForum. Page generated in 0.06419 seconds