Radio button controls provide users with the ability to make a single choice from a number of alternative options. Radio buttons are usually grouped, and each group is treated as one control (for more information see the Working With Radio Groups topic). The main feature of radio button controls is that when one radio button is selected, the other buttons of the current group cannot be selected (in other words, the choice is exclusive). For example, a group of radio buttons can provide a choice of font styles (regular, italic, bold or bold italic). The user can select only one of the styles, all the styles cannot be selected at the same time.
While testing radio button controls, you can use specific properties and methods of the corresponding program object to perform certain actions and obtain data stored in controls. You can call these methods and properties from your keyword tests, as well as from scripts. This topic describes how to work with the needed properties and methods from your scripts. However, when testing a control from your keyword test, you can use the same methods and properties calling them from keyword test operations. For more information, see Keyword Tests Basic Operations.
You can select the needed radio button in the following ways:
- By setting focus to it. You can set focus to a radio button by using the
SetFocusaction. The following code snippet demonstrates how to do this:
- By using the
ClickButtonaction. The actions belong to the
Win32RadioButtonobject, which is associated with standard radio button controls during the test run. Here is an example: