Opened 9 years ago

Closed 8 years ago

#2865 closed Bug (No Bug)

Autoit crash with NodeList on For In loop

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


$document = ObjCreate("HTMLFILE")
$document.write('<input type="hidden" name="test"/>')
$inputs = $document.querySelectorAll("input")
For $item = 0 To $inputs.length -1
	ConsoleWrite($inputs.item($item).name & @CRLF)

For To loop work fine, but For In leads to hard crash:

For $input In $inputs
	ConsoleWrite($ & @CRLF)

And it looks like a fall occurs when the script exits

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by jchd18

All I get is that:

"C:\Users\...\tmp\d.au3" (17) : ==> The requested action with this object has failed.:
$inputs = $document.querySelectorAll("input")
$inputs = $document^ ERROR

comment:2 Changed 9 years ago by anonymous

Try this. You need ie version >9+

#include <ie.au3>
$oIe = _IECreate('', 1)
$inputs = $oIe.document.querySelectorAll("input")
For $input In $inputs
	ConsoleWrite($ & @CRLF)

but in this example autoit crash browser

comment:3 Changed 8 years ago by mLipok

  • Resolution set to No Bug
  • Status changed from new to closed

This is related to IE object.

This was discussed and solved here:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.