Jump to content
Sign in to follow this  
GregH

Script freezes on .click event

Recommended Posts

GregH

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.

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Valuater

; Maybe try....
$hwnd = _IEPropertyGet($oIE, "hwnd")
$myClicker = _IEGetObjByName($o_myForm,"geoAdd")
$myClicker.focus
ControlSend($hwnd, "", "Internet Explorer_Server1", "{SPACE}")

... let me know!..??

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Valuater

WOW, Great minds think alike!!!...???

...

Edit: Hah! Beat Valuator to it! ^_^

;)

However, I thought a "space" is used to "select" a radio

8)

Edited by Valuater

NEWHeader1.png

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  

×