Technika Posted May 16, 2013 Share Posted May 16, 2013 (edited) Hi guys New to Autoit and this forum. Hoping to get some quality advice here. I am trying to write a script that will open a website in IE and enter an account number and do a search. I can get as far as opening up the website, however Can't really work out why it fails to input the account number and do the search. Could you guys please help me work out where I am going wrong? Thanks My script: #include <IE.au3> $oIE = _IECreate ("https://www.test.com/test/index") $o_form = _IEFormGetObjByName ($oIE, "f1") $o_account = _IEFormElementGetObjByName ($o_form, "ACCOUNT_NO") $o_signin = _IEFormElementGetObjByName ($o_form, "Wam.Action.Search") $accountnumber = "123456789" _IEFormElementSetValue ($o_account, $accountnumber) _IEAction ($o_signin, "click") And the following from Page Source: <HEAD> <META name="GENERATOR" content="IBM WebSphere Studio"> </HEAD> <table class="form" cellpadding="2" cellspacing="0" border="0" width="100%" align="middle"> <form action="/test/index" name="mainform" method="POST"> <input type='hidden' name='Wam.Tid' value='13ea875dae5'> <tr> <td colspan="4">Account no: <font face="Verdana" size="2"> <INPUT TYPE="TEXT" NAME="ACCOUNT_NO" VALUE="" SIZE="9" MAXLENGTH="9"></font> Customer no: <font face="Verdana" size="2"> <INPUT TYPE="TEXT" NAME="mainform1" VALUE="" SIZE="9" MAXLENGTH="9"></font> <INPUT TYPE="SUBMIT"VALUE="Search" NAME="Wam.Action.Search"> <INPUT TYPE="HIDDEN" NAME="FIELDMAP" VALUE="{ACCOUNT_NO=Params.AccountNumber}{mainform1=Params.CustomerNumber}"> </form> </table> <script> document.mainform.ACCOUNT_NO.focus(); // turn off right click on web browser to make it more difficult to print / view source if(navigator.appName.indexOf("Microsoft") != -1) document.oncontextmenu=function(){return false} </script> Edited May 16, 2013 by Technika Link to comment Share on other sites More sharing options...
mikell Posted May 16, 2013 Share Posted May 16, 2013 Try $o_form = _IEFormGetObjByName ($oIE, "mainform") Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now