bartekd Posted December 5, 2013 Posted December 5, 2013 Hello All, I am having issues with submitting a form. I am able to input the username and password using autoit, but it won't submit. Does anyone have ideas of what will work? I put the html snippet in the below as well of what works and what doesn't. This works fine... but I can't get it to submit $oForms = _IEFormGetCollection($oIE) $LForms = _IEFormGetCollection($oIE, 0) $LObjects = _IEFormElementGetCollection($LForms, -1) $oQueryl = _IEFormElementGetObjByName($LForms, "username") _IEFormElementSetValue($oQueryl, "1234") $oQueryl = _IEFormElementGetObjByName($LForms, "password") _IEFormElementSetValue($oQueryl, "123456") <INPUT value=1234 size=16 name=username autocomplete="off"> <----------- Works with above <INPUT value="" size=16 type=password name=password autocomplete="off"> <----------- Works with above <INPUT value=Login type=submit name=submit> <----------- Doesn't work with IESubmit
JohnOne Posted December 5, 2013 Posted December 5, 2013 Hello All, I am having issues with submitting a form. I am able to input the username and password using autoit, but it won't submit. Does anyone have ideas of what will work? I put the html snippet in the below as well of what works and what doesn't. This works fine... but I can't get it to submit $oForms = _IEFormGetCollection($oIE) $LForms = _IEFormGetCollection($oIE, 0) $LObjects = _IEFormElementGetCollection($LForms, -1) $oQueryl = _IEFormElementGetObjByName($LForms, "username") _IEFormElementSetValue($oQueryl, "1234") $oQueryl = _IEFormElementGetObjByName($LForms, "password") _IEFormElementSetValue($oQueryl, "123456") <INPUT value=1234 size=16 name=username autocomplete="off"> <----------- Works with above <INPUT value="" size=16 type=password name=password autocomplete="off"> <----------- Works with above <INPUT value=Login type=submit name=submit> <----------- Doesn't work with IESubmit You should try _IEFormSubmit. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
bartekd Posted December 5, 2013 Author Posted December 5, 2013 I tried that. both of these, and they both don't work $oForm = _IEFormGetObjByName($oIE, "Login") _IEFormSubmit($oForm, 0) $oForm = _IEFormGetObjByName($oIE, "submit") _IEFormSubmit($oForm, 0) Gives me this errors --> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch --> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType
JohnOne Posted December 5, 2013 Posted December 5, 2013 There are many reasons why it might not work. Be easier to get help if you show the webpage html code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
bartekd Posted December 5, 2013 Author Posted December 5, 2013 Here is the snippet of HTML code. Let me know if you want any more. expandcollapse popup<TABLE width="100%" height="32 " border="0" cellpadding="0" cellspacing="0" background="/MVAP/images/login/main_metal_strip.jpg" bgcolor="#000000"> <TR> <TD width="6" bgcolor="#000000"><IMG src="/MVAP/images/login/spacer.gif" width="6"></TD> <TD width="10" align="left" background="/MVAP/images/login/tube_left.gif"><IMG src="/MVAP/images/login/spacer.gif" width="10"></TD> <TD width="6"><IMG src="/MVAP/images/login/spacer.gif" width="6" height="10"></TD> <TD nowrap><TABLE width="100%" border="0" cellpadding="0" cellspacing="0"> <TR> <TD width="20" height="9"><IMG src="/MVAP/images/login/spacer.gif" width="1" height="1"></TD> <TD width="20"><IMG src="/MVAP/images/login/spacer.gif" width="1" height="1"></TD> <TD width="20"><IMG src="/MVAP/images/login/spacer.gif" width="1" height="1"></TD> </TR> <TR> <TD height="23"> </TD> <TD height="23" align="center" class="style16">Please log on. <BR> </TD> <TD height="23"> </TD> </TR> <TR> <TD height="10"><IMG src="/MVAP/images/login/spacer.gif" width="1" height="1"></TD> <TD><IMG src="/MVAP/images/login/spacer.gif" width="1" height="1"></TD> <TD><IMG src="/MVAP/images/login/spacer.gif" width="1" height="1"></TD> </TR> <TR> <TD> </TD> <TD height="8" align="center" valign="top"><TABLE border="0" cellspacing="0" cellpadding="0"> <TR> <TD align="right"><SPAN class="style16">Logon:</SPAN></TD> <TD width="6"><IMG src="/MVAP/images/login/spacer.gif"></TD> <TD> <INPUT autocomplete="off" name="username" type="text" value="" size="16"> </TD> </TR> <TR> <TD height="4" colspan="3" align="right"><IMG src="/MVAP/images/login/spacer.gif"></TD> </TR> <TR> <TD align="right" class="style16">Password:</TD> <TD><IMG src="/MVAP/images/login/spacer.gif"></TD> <TD> <INPUT autocomplete="off" name="password" type="password" value="" size="16"> </TD> </TR> <TR> <TD height="4" colspan="3" align="right"><IMG src="/MVAP/images/login/spacer.gif"></TD> </TR> <TR> </DIV></TD> </TR> <TR> <TD height="7" colspan="3" align="right"><IMG src="/MVAP/images/login/spacer.gif"></TD> </TR> <TR> <TD align="right"> </TD> <TD> </TD> <TD align="right"> <input type="submit" name="submit" value="Login"> </TD> </TR> </TABLE></TD>
bartekd Posted December 5, 2013 Author Posted December 5, 2013 You are the man!. It worked for me. I swear I saw that post about an hour ago, and it didn't work for me... Worked now. Thanks for your help.
michaelslamet Posted December 5, 2013 Posted December 5, 2013 You are the man!. It worked for me. I swear I saw that post about an hour ago, and it didn't work for me... Worked now. Thanks for your help. Glad to help
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