Silverlode Posted May 6, 2014 Share Posted May 6, 2014 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. Link to comment Share on other sites More sharing options...
JohnOne Posted May 6, 2014 Share Posted May 6, 2014 First thing I'd do is start error checking, and ensure I can actually get a handle to the window. WinGetHandle() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Silverlode Posted May 6, 2014 Author Share Posted May 6, 2014 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. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 6, 2014 Moderators Share Posted May 6, 2014 Can you show a screenshot of the window, as well as what the Window Info tool shows you regarding the radio buttons specifically? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
JohnOne Posted May 6, 2014 Share Posted May 6, 2014 Then I'd test if I could get a handle to the control. ControlGetHandle() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Silverlode Posted May 6, 2014 Author Share Posted May 6, 2014 Yes, I can get the ControlID handle as well. Link to comment Share on other sites More sharing options...
Silverlode Posted May 6, 2014 Author Share Posted May 6, 2014 JLo, I uploaded a screenshot to Google Drive: https://drive.google.com/file/d/0B44yhMhnPj0lX1lQV3g0MTNLZFE/edit?usp=sharing Link to comment Share on other sites More sharing options...
JohnOne Posted May 6, 2014 Share Posted May 6, 2014 Next I'd try to first give focus to the control before getting its property. ControlFocus() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Silverlode Posted May 6, 2014 Author Share Posted May 6, 2014 I CAN give it focus. Return is "1". Even THEN, after giving focus, my IsChecked is returning "0" (despite it being checked). Link to comment Share on other sites More sharing options...
JohnOne Posted May 6, 2014 Share Posted May 6, 2014 Looks like the control you're getting might be a collection of controls "[NAME:radioButton_Output_Items]" Try $state01 = ControlCommand("User Defined Accounts", "", "[TEXT:Items]", "IsChecked", "") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Silverlode Posted May 6, 2014 Author Share Posted May 6, 2014 Nope. Still getting "0", but I know "[TEXT:Items]" works because I tried it in my ControlGetHandle. Link to comment Share on other sites More sharing options...
JohnOne Posted May 6, 2014 Share Posted May 6, 2014 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. Link to comment Share on other sites More sharing options...
Silverlode Posted May 6, 2014 Author Share Posted May 6, 2014 Every time I open the dialog, the ID is different. I've never done a user-defined function. I'll look into it. Link to comment Share on other sites More sharing options...
JohnOne Posted May 6, 2014 Share Posted May 6, 2014 Yes it will be different, but does it work? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Silverlode Posted May 6, 2014 Author Share Posted May 6, 2014 No. Link to comment Share on other sites More sharing options...
JohnOne Posted May 6, 2014 Share Posted May 6, 2014 Bad news then for getting info from conventional API. Looks like you'll have to try your hand with other UDF. '?do=embed' frameborder='0' data-embedContent>> LarsJ 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
LarsJ Posted May 7, 2014 Share Posted May 7, 2014 Good answer JohnOne. Is that you on the picture? It's not Tony Benn. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
JohnOne Posted May 7, 2014 Share Posted May 7, 2014 haha. Spike Milligan AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now