Jump to content

Difficulty submitting web page forms


Recommended Posts

Hi all,

 

I've created a script to rotate between browser pages and a local app and all is working dandy. I am however having difficulties with submitting the page data.

 

Where the username and email field can be handled via _IEGetObjByName, the submit button doesn't have an elementID that I can use:

<button class="btn blue form-login full-width" type="submit" tabindex="3">Login</button>

 

I've tried to use _IEFormSubmit and tried tab to the index but not having much luck. Can anyone advise on a way to approach this?

I'm happy with how to use the co-ordinates approach and clicking on the button but don't feel this is viable long term....

 


Script below:

 

 

#include <IE.au3>

Local $dropTask = _IECreate("DropTask.com/login")
$dropTaskHandle = _IEPropertyGet($dropTask, "hwnd") ; Get Handle of the IE window
WinSetState($dropTaskHandle, "", @SW_MAXIMIZE)

$dropTaskUsername = _IEGetObjByName($dropTask, "email")
_IEFormElementSetValue($dropTaskUsername, "email@email.co.uk)

$dropTaskPassword = _IEGetObjByName($dropTask, "password")
_IEFormElementSetValue ($dropTaskPassword, "Password123")

; submit form code needs to go here

 


Sleep(30000)
WinSetState($dropTaskHandle, "", @SW_HIDE)


; other code omitted as not relevant

 

 

 

Cheers,

Wendalllllllllllllllllllllllllllllll woof.

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...