Mailingliste - Einträge 2005

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Using check node to find state of JButton doesn't work?

  • Subject: Re: [qftestJUI] Using check node to find state of JButton doesn't work?
  • From: William Deegan <bill.deegan@?.com>
  • Date: Fri, 24 Jun 2005 15:18:45 -0700

what's the class of the button? If you're not sure, set the option
"Record->Components->Record system classes only" and record the button
in a new test-suite, then look at the class attribute in the component node.

The class of the button is : JButton
Any reason you don't have selected for JButton?

I asked the developer why it wasn't JToggleButton. ( he inherited the code from
another developer), and he's since changed it.
But, the JButton does have a isSelected() method, so perhaps it would be worthwhile
to allow a selected check on a JButton?

Currently qftestJUI treats JToggleButton (and thus JCheckBox and
JRadioButton), as well as JCheckBoxMenuItem and JRadioButtonMenuItem
as selectable and offers the appropriate check. Have we missed
something? Pure AWT components at least.

Anyway, you can use Jython for the check:

com = rc.getComponent("id of button")
rc.check(com.isSelected(), "Check button selected state")
I did get the above logic working, but it would be nice to avoid having
to do this for semi-standard widgets.


Best regards,

William Deegan <bill@?.com> writes:


I'm trying to check the state of a jbutton before clicking it
to create procedures for setting/clearing the button.

Unfortunately I cannot check the state, when I try to create a check node
on the button I'm presented with the following possibilities:
* Text
* Enabled State
* Image
* Image (Visible Region)
* Geometry

What I'd like is a "is selected"  to check if the button is pushed or not.
Am I missing something?
Can this be done using Jython?

qftestJUI-list mailing list