Jump to content

Script freezes on .click event


 Share

Recommended Posts

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

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 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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...