Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » click on check-style button does not make it checked/unchecked
click on check-style button does not make it checked/unchecked [message #22799] Wed, 18 February 2009 14:57 Go to next message
Marc is currently offline MarcFriend
Messages: 32
Registered: July 2009
Member
Hi,

I came across this behavior:
I used the click() method (from SWTBotButton) on a SWT.CHECK style Button.
The button did react to it and launched its action as with a real user.
But the problem is that the button kept its state (checked or unchecked),
which lead to bugs in the app.

I found I had to manually ask for a change in the state of the button.

I mean, instead of:
Button myButton = ((Button)bot.widget(myButtonMatcher, 3));
(new SWTBotButton(myButton)).click();

I had to use:
Button myButton = ((Button)bot.widget(myButtonMatcher, 3));
myButton.setSelection(true);
(new SWTBotButton(myButton)).click();


I think this is a bug (or maybe more like a leak), I can add a bugzilla
when I get some more time, I wanted to tell it before (or in case there
was an explaination to that).
I reproduced it on windows, I can't check other OS.
Re: click on check-style button does not make it checked/unchecked [message #22930 is a reply to message #22799] Thu, 19 February 2009 00:50 Go to previous message
Ketan Patel is currently offline Ketan PatelFriend
Messages: 68
Registered: July 2009
Member
you should not be using SWTBotButton for check box buttons. There is
special class for check boxes, SWTBotCheckBox. You can find it using
org.eclipse.swtbot.swt.finder.SWTBot.checkBox* methods.
Previous Topic:Open perspective
Next Topic:PROPERTIES OF COMPONENTS
Goto Forum:
  


Current Time: Fri Dec 19 03:15:45 GMT 2014

Powered by FUDForum. Page generated in 0.02090 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software