Jump to content

Can't submit a form in IE

Recommended Posts

Trying to submit a form in IE, and I keep getting an error.. was working fine, and then all of a sudden stopped



$sUsername = "usernamegoeshere"
$sPassword = "passwordgoeshere"
$sUrl = "http://loginpageshere"
$oIE = _IECreate($sUrl, 0, 1, 0, 0)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, 'username')
$oPassword = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)

Error is:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Deon\Documents\NameOfScript.au3"    
"C:\Program Files (x86)\AutoIt3\Include\IE.au3" (904) : ==> Variable must be of type "Object".:
Case $i_index > -1 And $i_index < $oTemp.forms.length
Case $i_index > -1 And $i_index < $oTemp^ ERROR
>Exit code: 1    Time: 2.730
Any assistance appreciated! Edited by Deon
Link to comment
Share on other sites

i would suggest checking the error/return values from each of the functions to see what is failing

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

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

  • Recently Browsing   0 members

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