GregH Posted April 21, 2009 Share Posted April 21, 2009 I am including IE.au3 I am automating some tasks in IE and I have a popup window that I have to click a radio button for. The problem is the radiobutton isn't part of a group so _IEFormElementRadioSelect requires a group name or it will not work. I tried teh object name as the group nemae to no avail. So I went about it another way. . . I attach to teh Window $myGeoIE = _IEAttach("GeoAddress Selector","title") I grab the frame $o_myForm = _IEFormGetObjByName($myGeoIE,"geo") I grab the radio button name $myClicker = _IEGetObjByName($o_myForm,"geoAdd") And I click $myClicker.click But when the last line executes the script freezes. I tried ConsoleWrite("Gonna Click") $myClicker.click ConsoleWrite("Clicked") and I get teh "Gonna Click" written to the console but that is it and the script is still running, just frozen. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 21, 2009 Share Posted April 21, 2009 (edited) I am including IE.au3 I am automating some tasks in IE and I have a popup window that I have to click a radio button for. The problem is the radiobutton isn't part of a group so _IEFormElementRadioSelect requires a group name or it will not work. I tried teh object name as the group nemae to no avail. So I went about it another way. . . I attach to teh Window $myGeoIE = _IEAttach("GeoAddress Selector","title") I grab the frame $o_myForm = _IEFormGetObjByName($myGeoIE,"geo") I grab the radio button name $myClicker = _IEGetObjByName($o_myForm,"geoAdd") And I click $myClicker.click But when the last line executes the script freezes. I tried ConsoleWrite("Gonna Click") $myClicker.click ConsoleWrite("Clicked") and I get teh "Gonna Click" written to the console but that is it and the script is still running, just frozen. Any help would be greatly appreciated. Could you post the HTML around this element? I'm wondering if a single radio button might actually be a checkbox. For the work-around, try: $hIE = _IEPropertyGet($myGeoIE, "hwnd") _IEAction($myClicker, "focus") ControlSend($hIE, "", "", "{SPACE}") The synthetic .click doesn't trigger the onclick events and scripts for some objects. Edit: Hah! Beat Valuator to it! P.S. He was right that "{SPACE}" is better than "{ENTER}" for this, as the later may lead to "Submit" rather than simply toggling the selection. Edited April 21, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Valuater Posted April 21, 2009 Share Posted April 21, 2009 ; Maybe try.... $hwnd = _IEPropertyGet($oIE, "hwnd") $myClicker = _IEGetObjByName($o_myForm,"geoAdd") $myClicker.focus ControlSend($hwnd, "", "Internet Explorer_Server1", "{SPACE}") ... let me know!..?? 8) Link to comment Share on other sites More sharing options...
Valuater Posted April 21, 2009 Share Posted April 21, 2009 (edited) WOW, Great minds think alike!!!...???...Edit: Hah! Beat Valuator to it! However, I thought a "space" is used to "select" a radio8) Edited April 21, 2009 by Valuater 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