I've been playing around with this for awhile now and it has me stumped. I'm trying to automate a webform and have been unsuccessful in editing the form input. Send is the only method that I've got working but I can't use that as the script will run in the background. My attempts at using control send failed miserably. My attempts at _IEFormElementSetValue failed as well. Can anyone offer any suggestions, direction, guidance, or direction on how I can accomplish this?
Here's the current AutoIT code I've been using.
$new_page = "http://10.131.180.109/RemoteAdmin/updateform.html"
$tmp_page = _IECreate($new_page,0,1,0,-1)
;_IELoadWait($tmp_page,100,2000)
$Auth_Active=winwaitactive("Connect to","",20000)
$results=WinExists("Connect to")
if $Auth_Active = 1 Then
controlsend("Connect to","","Edit2","admin")
controlsend("Connect to","","Edit3","smartlane")
controlclick("Connect to","","Button2")
EndIf
_IEloadwait($tmp_page,1000,15000)
$oForms = _IEFormGetCollection ($tmp_page,0)
$oForm = _IEFormGetObjByName ($oForms, $oForms.name)
$oQuery1 = _IEFormElementGetCollection ($oForm, 0)
_ieformelementsetvalue($oQuery1,"C:\Work\Irisys\SDI_files\SmartlaneCAB.CAB",1)
I've also tried this:
$new_page = "http://10.131.180.109/RemoteAdmin/updateform.html"
$tmp_page = _IECreate($new_page,0,1,0,-1)
;_IELoadWait($tmp_page,100,2000)
$Auth_Active=winwaitactive("Connect to","",20000)
$results=WinExists("Connect to")
if $Auth_Active = 1 Then
controlsend("Connect to","","Edit2","admin")
controlsend("Connect to","","Edit3","smartlane")
controlclick("Connect to","","Button2")
EndIf
_IEloadwait($tmp_page,1000,15000)
$oForms = _IEFormGetCollection ($tmp_page,0)
$oForm = _IEFormGetObjByName ($oForms, $oForms.name)
$oQuery1 = _IEFormElementGetCollection ($oForm, 0)
$hwnd=_IEPropertyGet($oForm,"hwnd")
controlsend($hwnd,"","","C:\Work\Irisys\SDI_files\SmartlaneCAB.CAB")
I've tried a few other things that I can't remember off the top of my head as well but to no avail. Many of the other attempts were various ways of using controlsend.
Here's the html from the page.
<form name="configForm" enctype='multipart/form-data' action='/web/SLPlugin.dll?action=UpdateSystem' onsubmit="return initReporting();" method=post>
Please select the SDI update CAB file to upload<br />
<br />
<input name=cabfile id=cabfile type=file size=40 onchange='checkCAB();' /><br />
<div id='cabError' style='color: #ff3333;'></div>
<br />
<input type=hidden name=submitupdate value="Upgrade SDI" />
<div class="controls"><a href="#" class="button" onclick="initReporting();"><b><b><b>Update SDI</b></b></b></a></div>
<br clear="both" />
</form>