qontro1

IE Form - Submit button not activated

4 posts in this topic

Hi,

I am trying to automate authentication to this web application, and whilst the fields are populated using the below script, it does not seem to activate the submit button, that is, it CAN'T be pressed. I have tried using IEActions such as click/focus prior to input, doesn't seem to work. I need to enter a character manually into each field before it is activated. Any suggestions appreciated.

 

Thank you.

 

Code and form below.

 

#include <IE.au3>
Global Const $exe                                    = "C:\Program Files (x86)\Internet Explorer\iexplore.exe https://10.0.0.1" 
Global Const $un = "abcdefg"
Global Const $pw = "1234567"
Run($exe)
WinWait("Title - Internet Explorer")
WinActive("Title - Internet Explorer")
Sleep(2000)
Local $oIE = _IEAttach("","instance",1)
Local $oForm = _IEFormGetCollection($oIE, 0)
Local $unfield = _IEFormElementGetCollection($oForm, 0)
Local $pwfield = _IEFormElementGetCollection($oForm, 1)
Local $oSubmit = _IEFormElementGetCollection($oForm, 2)
_IEFormElementSetValue($unfield, $un)
_IEFormElementSetValue($pwfield, $pw)
_IEAction($oSubmit,"click")
 

 

<form data-bind="submit: login, visible: !pvm.loggingIn()" role="form" lpformnum="1">
      <div class="form-group">
        <label>Username</label><input class="form-control" data-bind="textInput: username" placeholder="enter your username" type="text" style="background-image: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAAAXNSR0IArs4c6QAAAPhJREFUOBHlU70KgzAQPlMhEvoQTg6OPoOjT+JWOnRqkUKHgqWP4OQbOPokTk6OTkVULNSLVc62oJmbIdzd95NcuGjX2/3YVI/Ts+t0WLE2ut5xsQ0O+90F6UxFjAI8qNcEGONia08e6MNONYwCS7EQAizLmtGUDEzTBNd1fxsYhjEBnHPQNG3KKTYV34F8ec/zwHEciOMYyrIE3/ehKAqIoggo9inGXKmFXwbyBkmSQJqmUNe15IRhCG3byphitm1/eUzDM4qR0TTNjEixGdAnSi3keS5vSk2UDKqqgizLqB4YzvassiKhGtZ/jDMtLOnHz7TE+yf8BaDZXA509yeBAAAAAElFTkSuQmCC&quot;); background-repeat: no-repeat; background-attachment: scroll; background-size: 16px 18px; background-position: 98% 50%; cursor: auto;" autocomplete="off">
      </div>
      <div class="form-group">
        <label>Password</label><input class="form-control" data-bind="textInput: password" type="password" style="background-image: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAAAXNSR0IArs4c6QAAAPhJREFUOBHlU70KgzAQPlMhEvoQTg6OPoOjT+JWOnRqkUKHgqWP4OQbOPokTk6OTkVULNSLVc62oJmbIdzd95NcuGjX2/3YVI/Ts+t0WLE2ut5xsQ0O+90F6UxFjAI8qNcEGONia08e6MNONYwCS7EQAizLmtGUDEzTBNd1fxsYhjEBnHPQNG3KKTYV34F8ec/zwHEciOMYyrIE3/ehKAqIoggo9inGXKmFXwbyBkmSQJqmUNe15IRhCG3byphitm1/eUzDM4qR0TTNjEixGdAnSi3keS5vSk2UDKqqgizLqB4YzvassiKhGtZ/jDMtLOnHz7TE+yf8BaDZXA509yeBAAAAAElFTkSuQmCC&quot;); background-repeat: no-repeat; background-attachment: scroll; background-size: 16px 18px; background-position: 98% 50%; cursor: auto;" autocomplete="off">
      </div>
      <button class="btn btn-default" data-bind="enable: enableLoginButton" type="submit" disabled="">Log In</button>
    </form>

Share this post


Link to post
Share on other sites



Have you tried _IEFormSubmit?

Share this post


Link to post
Share on other sites

Yeah the problem is that the text doesn't seem to be activating the button, as in, you can't click it. 

Share this post


Link to post
Share on other sites

You need to examine the code within the HTML page to determine what event (onkeypress, onkeyup, etc) they are expecting. Then you could use fireEvent to force it to occur.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now