Sign in to follow this  
Followers 0
Silverlode

Can't get state of radio button

18 posts in this topic

Hello everyone.

I have a dialog in an application I'm doing some automation testing for that has radio buttons for which I need to state of each.  They're all returning "0".  Here's my code right now:

$state01 = ControlCommand("User Defined Accounts", "", "[NAME:radioButton_Output_Items]", "IsChecked", "")
MsgBox(0, "", $state01)

I've also tried _GuiCtrlButton_GetCheck.  Nothing works.  "0" is always returned.  Any ideas?

Thank you.

Share this post


Link to post
Share on other sites



I can get a handle.

Local $handle01 = WinGetHandle("User Defined Accounts")
If @error Then
        MsgBox($MB_SYSTEMMODAL, "", "An error occurred when trying to retrieve the window handle of User Defined Accounts.")
        Exit
    EndIf

MsgBox($MB_SYSTEMMODAL, "", $handle01)

The handle (0x0022035A) is displayed in the MsgBox.

Share this post


Link to post
Share on other sites

Can you show a screenshot of the window, as well as what the Window Info tool shows you regarding the radio buttons specifically?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Yes, I can get the ControlID handle as well.

Share this post


Link to post
Share on other sites

I CAN give it focus.  Return is "1".

Even THEN, after giving focus, my IsChecked is returning "0" (despite it being checked).

Share this post


Link to post
Share on other sites

#11 ·  Posted

Nope.  Still getting "0", but I know "[TEXT:Items]" works because I tried it in my ControlGetHandle.  :(

Share this post


Link to post
Share on other sites

#12 ·  Posted

Could just be that this .net window is not going to play ball, and you may have to use UIAutomation UDF in example scripts.

Have you tried using the ID directly?

$state01 = ControlCommand("User Defined Accounts", "", 329246, "IsChecked", "")

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#13 ·  Posted

Every time I open the dialog, the ID is different.  I've never done a user-defined function.  I'll look into it.

Share this post


Link to post
Share on other sites

#15 ·  Posted

No.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0