Dear All,
I am trying to login to website using AutoIT script but its failed, throwing the below error msg.
"Return SetError($_IESTATUS_Success, 0, $oObject.document)"
"Error: The requested action with this object has failed"
Please check my below code:
Func MyFunc()
Local $sUsername = "***"
Local $sPassword = "***"
$sUrl = "http://appName:8005/OA_HTML/RF.jsp"
$oIE = _IECreate($sUrl, 0, 1, 0, 1)
Sleep(2000)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, 'unamebean') ; change name !
$oPassword = _IEFormElementGetObjByName($oForm, "pwdbean") ; change name !
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
; This is my custom defined error handler
_IEFormSubmit($oForm)
EndFunc
Please advise why the above failed, what is the cause of this issue.
If possible, share with me a working example.