99ojo Posted November 17, 2009 Share Posted November 17, 2009 (edited) Hi, i want to click Submit Button. I'm able to fill Inputs with username and password. Problems: 1) No Form -> _IEFormSubmit doesn't work. 2) No button defined, so i can't get button id. ;-(( Stefan SourceCode WebSite: <HEAD> <TITLE> Server Administration </TITLE> <META NAME="IBMproduct" CONTENT="ADSM"> <META NAME="IBMproductVersion" CONTENT="5.3.4.0"> <META HTTP-EQUIV="expires" CONTENT="now"> </HEAD> <FRAMESET ROWS="70,*" border="0" frameborder="0"> Content-type: text/html <HEAD> <TITLE> Administrator Login </TITLE> <META NAME="IBMproduct" CONTENT="ADSM"> <META NAME="IBMproductVersion" CONTENT="5.3.4.0"> </HEAD> <BODY bgcolor=#FFFFFF> <IMG SRC="/file/ADSMSERV.GIF" ALT="Administrator Login"> <br> Storage Management Server for Windows - Version 5, Release 3, Level 4.0 <br> Connected to <b>Servername_SERVER1</b> as <b>?</b> <hr noshade color=#CCCCCC> <table border=0 callpadding=0 cellspacing=0 width="100%"> <tr> <td valign="top"> </td> <td width="100%"> <b>Administrator Login</b> </td> </tr> </table> <P> <center> <table cellspacing="0" width="85%" cellpadding="0"> <form method="post" action="/SignOnPost"> <tr valign="middle"> <td nowrap align="right"> <input type="hidden" name="$PP1" value="LOGIN"> <span class="form_title">Userid:</span> </td> <td nowrap align="left"> <input name="USERID" size="15" maxlength="64"> </td> </tr> <tr> <td nowrap align="right"> <span class="form_title">Password:</span> </td> <td nowrap align="left"> <input type="password" name="PASSWORD" size="15" maxlength="64"> </td> </tr> <tr> <td colspan="2" align="middle"> <input type="submit" value="Submit"> </td> </tr> </form> </table> </center> </NOFRAMES> <FRAME src="/banner/banner.frame" name="bannerframe"scrolling="no" marginwidth="0" marginheight="0" > <FRAME src="/signon" name="signonframe"> </FRAMESET> <NOFRAMES> Content-type: text/html <HEAD> <TITLE> Administrator Login </TITLE> <META NAME="IBMproduct" CONTENT="ADSM"> <META NAME="IBMproductVersion" CONTENT="5.3.4.0"> </HEAD> <BODY bgcolor=#FFFFFF> <IMG SRC="/file/ADSMSERV.GIF" ALT="Administrator Login"> <br> Storage Management Server for Windows - Version 5, Release 3, Level 4.0 <br> Connected to <b>Servername_SERVER1</b> as <b>?</b> <hr noshade color=#CCCCCC> <table border=0 callpadding=0 cellspacing=0 width="100%"> <tr> <td valign="top"> </td> <td width="100%"> <b>Administrator Login</b> </td> </tr> </table> <P> <center> <table cellspacing="0" width="85%" cellpadding="0"> <form method="post" action="/SignOnPost"> <tr valign="middle"> <td nowrap align="right"> <input type="hidden" name="$PP1" value="LOGIN"> <span class="form_title">Userid:</span> </td> <td nowrap align="left"> <input name="USERID" size="15" maxlength="64"> </td> </tr> <tr> <td nowrap align="right"> <span class="form_title">Password:</span> </td> <td nowrap align="left"> <input type="password" name="PASSWORD" size="15" maxlength="64"> </td> </tr> <tr> <td colspan="2" align="middle"> <input type="submit" value="Submit"> </td> </tr> </form> </table> </center> </NOFRAMES> Code so far: #include <ie.au3> _tsm () Func _tsm () $oIE = _IECreate ("http://servername:1580") $oFrame = _IEFrameGetCollection ($oIE, 1) $oUserID = _IEGetObjByName ($oFrame, "USERID") $oPassword = _IEGetObjByName ($oFrame, "PASSWORD") _IEFormElementSetValue ($oUserID, "admin") _IEFormElementSetValue ($oPassword, "xxxxxxxxx") EndFunc Edited November 17, 2009 by 99ojo Link to comment Share on other sites More sharing options...
jvanegmond Posted November 17, 2009 Share Posted November 17, 2009 The form is right here:<form method="post" action="/SignOnPost">You can get it by _IEFormGetCollection using an index.You can also get the button by _IEFormElementGetCollection and an index._IEFormSubmit should work fine. github.com/jvanegmond Link to comment Share on other sites More sharing options...
99ojo Posted November 17, 2009 Author Share Posted November 17, 2009 (edited) The form is right here: <form method="post" action="/SignOnPost"> You can get it by _IEFormGetCollection using an index. You can also get the button by _IEFormElementGetCollection and an index. _IEFormSubmit should work fine. Hi, thanks for suggestion, but.... If i add this lines after $oIE= ... $oForm = _IEFormGetCollection ($oIE, 0) -> One form detect, but error in console MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page") -> Message: There are 1 forms on this page. Then: $obutton = _IEFormElementGetCollection ($oForm, 9)-> different values from 0 - 9 always error in console. --> IE.au3 V2.4-0 Warning from function _IEFormGetCollection, $_IEStatus_NoMatch --> IE.au3 V2.4-0 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType #include <ie.au3> _tsm () Func _tsm () $oIE = _IECreate ("http://servername:1580") $oForm = _IEFormGetCollection ($oIE, 0) $obutton = _IEFormElementGetCollection ($oForm, 9) ;MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page") $oFrame = _IEFrameGetCollection ($oIE, 1) $oUserID = _IEGetObjByName ($oFrame, "USERID") $oPassword = _IEGetObjByName ($oFrame, "PASSWORD") _IEFormElementSetValue ($oUserID, "admin") _IEFormElementSetValue ($oPassword, "xxxxxxxxx") ;_IEFormSubmit ($oForm) _IEAction ($obutton, "Click") EndFunc ;-(( Stefan Edited November 17, 2009 by 99ojo Link to comment Share on other sites More sharing options...
jvanegmond Posted November 17, 2009 Share Posted November 17, 2009 You have to get the form from inside the frame still, like you do with the other objects.$oForm = _IEFormGetCollection ($oFrame, 0) github.com/jvanegmond Link to comment Share on other sites More sharing options...
99ojo Posted November 17, 2009 Author Share Posted November 17, 2009 (edited) You have to get the form from inside the frame still, like you do with the other objects.$oForm = _IEFormGetCollection ($oFrame, 0)Hi,thanks a lot. Too much trees in the forest...IEFormSubmit is working perfectly, so i didn't try to catch the button.;-))Stefan Edited November 17, 2009 by 99ojo Link to comment Share on other sites More sharing options...
jvanegmond Posted November 17, 2009 Share Posted November 17, 2009 Great. Happy programming. github.com/jvanegmond 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