Jump to content

_IEFormSubmit


Recommended Posts

So, I'm using AIT to navigate some sections of a website and fill in data as needed. At the very end, I'm using the _IEFormSubmit line to progress, but it produces a blank white page only and never goes anywhere. I've looked through the threads here and it looks like there were a few others with the same issue.

Local $oForm = _IEFormGetObjByName ($oIE, "modifydevice")
Local $oText = _IEFormElementGetObjByName ($oForm, "cos")
_IEFormElementOptionSelect ($oText, "Param")
Local $oText = _IEFormElementGetObjByName ($oForm, "Param2")
_IEFormElementOptionSelect ($oText, "Param3")
_IEFormSubmit($oForm)

Yet, if I use the acutal mouse, it works. Is there another way to achieve this without ExecScript?

Edited by prismite
Link to comment
Share on other sites

<form action='index.php' method='post'>
    Username: <input type='text' name='username' size='25' /><br />
    Password: <input type='password' name='password' size='25' /><br />
    <input type='submit' name='ok' value='Submit' />
</form>

for this example, you can do

$submit = _IEGetObjByName($bro, "ok")
_IEAction($submit, "click")

you can go with "_IEGetObjById" if button has an <input ID="blabla">

 

btw if u are using Win7, Win8 or Win8.1 you can check this out: '?do=embed' frameborder='0' data-embedContent>>

Edited by Coder07
Link to comment
Share on other sites

Hi guys, and thanks for taking the time to respond!

I have tried both of these, but the problem I'm running into is that the site uses several variables multiple times. Here is an actual snippet that I'm working with (results are from an "action" search of the original code)...

<TD CLASS="resultsB" colspan=4><br>&nbsp;<INPUT TYPE="submit" name="action" value="Add" TABINDEX=10>
<IMG height=1 src="images/spacer.gif" width=400 alt="spacer"><INPUT TYPE="submit" name="action" value="Submit" TABINDEX=11>
<IMG height=1 src="images/spacer.gif" width=4 alt="spacer"><INPUT TYPE="reset" name="action" value="Reset" TABINDEX=12>

 

I chose "action" because the _IEFormGetObjByName fuctions off the "Name" label (obviously) but as you see, this is true for 3 elements on this page.

I have tried 

_IEFormSubmit($oForm)

and that takes me to a blank white page. 

I have tried 

Local $oForm = _IEGetObjByName($oIE, "submit", 11)
Local $oPost = _IEAction($oForm, "click")

But that yeilds an error of:

--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: submit, Index: 11)
--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType
 
Ditto for an index of 1.
 
I have tried 
Local $oForm = _IEGetObjByName($oIE, "action", "submit")
Local $oPost = _IEAction($oForm, "click")

This one has come the closest to working because it activates the first instance of "Submit" which is really an "add" button. I need it to activate the 2nd instance.

Edited by prismite
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...