Jump to content

Recommended Posts

I'm trying to write a login script. I can get the USER and PASSWORD elements to populate on the form but I can't get the form to submit. I've tried a bunch of combinations of different commands but none seem to work. I'm not sure what I'm doing wrong. I've attached the generated HTML from the site if that helps.

Here is the code.



#include <IE.au3>

; Open a new browser and goto oracle site

$o_IE = _IECreate ("http://erpgltest.health.ge.com:8803/OA_HTML/US/gltest_sso.jsp")

; Get the login form and elements

$o_form = _IEFormGetObjByName($o_IE, "login")

$o_login = _IEFormElementGetObjByName($o_form, "USER")

$o_password = _IEFormElementGetObjByName($o_form, "PASSWORD")

;$o_submit = _IEFormElementGetObjByName($o_form, "Login")

; Set field values and submit the form



; cannot get code to work using any combination of the following commands


;_IEAction($o_submit, "click")



; can get it to work by sending keystrokes, which is sloppy






;$oDoc = _IEDocGetObj ($o_IE)

;ConsoleWrite($oDoc.documentElement.innerHTML & @crlf)



Link to post
Share on other sites

Take a look at _IEFormImageClick

"input type=image" elements are one of the oddities of the DOM -- they are not in fact included as part of the form element collection, although they act like one. This is why this special function exists.

_IEFormImageClick($o_IE, "Submit", "alt") should do the trick.


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...