Jump to content

_IEFormSubmit


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.

Thanks,

-Tyler

#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

_IEFormElementSetValue($o_login,"myUSER")

_IEFormElementSetValue($o_password,"myPASSWORD")

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

;_IEImgClick($o_form,"../img/action_submit.gif","src")

;_IEAction($o_submit, "click")

_IEFormSubmit($o_form,0)

_IELoadWait($o_IE)

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

;Send("{ENTER}")

;Sleep(2000)

;Send("{ENTER}")

;Sleep(60000)

;_IELoadWait($o_IE)

;$oDoc = _IEDocGetObj ($o_IE)

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

Exit

html_log_on_page.txt

Link to comment
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.

Dale

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