Mailing list - Entries of 2005


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

Re: [qftestJUI] retrieve enabled state of a menu item


  • Subject: Re: [qftestJUI] retrieve enabled state of a menu item
  • From: Karlheinz Kellerer <Karlheinz.Kellerer@?.de>
  • Date: Thu, 10 Feb 2005 13:27:02 -0000

Hi Michael,

"Feerick, Michael" <Michael.Feerick@?.com> writes:
> Hi
> I am trying to retrieve the enabled state of a menu item in a script so i
> can set a variable but i am not having any luck.
> Does any one know the syntax of the code to retrieve this as i have not been
> able to find it in the docs.?
> I can place a check for the state via the GUI but cannot retrieve this value
> to set a variable for my test.


If you want to go for the "check node", you can use following structure:

...ensure the menu item is visible.

+ try
  - check enabled status (your menu item) [Throw exception on failure]
  - set variable (enabled -> true)
  + catch (CheckFailedException)
    - set variable (enabled -> false)



If you want use a SUT-script, the e.g. following should work:


com = rc.getComponent("id_of_menu_item")
if com.isEnabled():
    rc.setGlobal("enabled","true")
else:
    rc.setGlobal("enabled","false")


Best regards,
    Karl

--
Karlheinz Kellerer                     Karlheinz.Kellerer@?.de
Quality First Software GmbH                    http://www.qfs.de


Videos Downloads Documentation Buy Free Trial