Jump to content

Issues in _IEFormElementGetCollection($oIE)


 Share

Recommended Posts

Hi,

Please find below code. I had written this code to display controls present in the auto it login page. I think this code is correct. But i am not getting any control name in the output. Can you please tell me why it is not not displaying any output?.

#include <IE.au3>

$oIE = _IECreate()

$navigate=_IENavigate($oie,"http://www.autoitscript.com/forum/index.php?act=Login&CODE=00")

$oForm= _IEFormGetCollection($oIE, 0)

$elements = _IEFormElementGetCollection($oIE)

For $oelement in $elements

ConsoleWrite($oelement.name)

Next

And also i need the code to submit the login page. Once i submitted the form through _IEFormSubmit i have to display all the controls present in the next page(after login page). Please give me sample code after login page also.

Link to comment
Share on other sites

Look at this example:

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com")
$oForms = _IEFormGetCollection ($oIE)
MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
For $oForm In $oForms
    MsgBox(0, "Form Info", $oForm.name)
Next

You need to loop through the @extended information to get what you need.

From the helpfile:

Success: Returns an object variable containing the Form Elements collection, @EXTENDED = form element count

Link to comment
Share on other sites

Please execute this.

#include <IE.au3>

$oIE = _IECreate ("http://www.autoitscript.com")

$oForms = _IEFormGetCollection ($oIE,0)

$elements = _IEFormElementGetCollection($oForms)

;MsgBox(0, "Elements Info", "There are " & @extended & " elements on this page")

For $oelement in $elements

ConsoleWrite($oelement.name)

Next

I am getting below errors.

--> IE.au3 V2.4-0 Warning from function _IEFormGetCollection, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

D:\AUTOMATION\Innovative Scripts\test\Pages\sparshy.au3 (31) : ==> Variable must be of type "Object".:

For $oelement in $elements

For $oelement in $elements^ ERROR

->10:25:30 AutoIT3.exe ended.rc:1

>Exit code: 1 Time: 5.654

Link to comment
Share on other sites

Go back to the first error: NoMatch

There are no forms on that page.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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