Getting a Radio Button's Image in Desktop Windows Applications

Applies to TestComplete 15.69, last modified on November 13, 2024

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.

The radio button controls you are working with can have a special image. If you need to get this image, you can obtain it by using the wImage property. This property belongs to the Win32RadioButton object, which is associated with standard Windows radio button controls during a test execution. This property returns the Picture object that contains the control's image (for more information on the Picture object, see the Picture Object topic). The following code snippet copies a radio button’s image to the clipboard:

JavaScript, JScript

...
bImage = Sys.Process("MyApp").Window("MainWin").Window("MyRadioButton");
Sys.Clipboard = bImage.wImage;
...

Python

...
bImage = Sys.Process("MyApp").Window("MainWin").Window("MyRadioButton")
Sys.Clipboard = bImage.wImage
...

VBScript

...
Set bImage = Sys.Process("MyApp").Window("MainWin").Window("MyRadioButton")
SetSys.Clipboard = bImage.wImage
...

DelphiScript

...
bImage := Sys.Process('MyApp').Window('MainWin').Window('MyRadioButton');
Sys.Clipboard := bImage.wImage;
...

C++Script, C#Script

...
bImage = Sys["Process"]("MyApp")["Window"]("MainWin")["Window"]("MyRadioButton");
Sys["Clipboard"] = bImage["wImage"];
...

See Also

Working With Radio Button Controls in Desktop Windows Applications
wImage Property (RadioButton Controls)
Picture Object

Highlight search results