Jump to content
Sign in to follow this  

little help with an IE function

Recommended Posts

first off, great program, and im just beginning. dont make me cry in shame, my coding practices on this are not 2nd nature yet.

I have been making a gui with auto it 3 that basicly gets a list of tools from an ini file (gets it from a php page for centralized database of the tools) then puts them into a treeview.

when an item is clicked in the tree view it fires a function which:

1. grabs a new ini file with that tools information with things like login url, form name, form username field, form password field, form submit button field, etc. basicly everthing it would need to auto fill the form and submit it.

2. it opens the url in the ini file for that tool and proceeds to fill out the form and submit it.

all that works great, and everything was looking really good when i found a problem i couldnt figure out.

been trying for 8 hours now to no avail.

if the form that is submitted is on say, domain.com, and it redirects when login was successful to a different domain without any kind of page saying login was successful (ex. toolname.com) then the script gets stuck in a sleep condidtion waiting for the page to load. (even though its loaded fine showing the toolname.com webpage) it gets stuck in line 617 of IE.au3 and it makes the script unusable until the back button is hit on the browser window making it go back to domain.com.

any ideas on what i can do to get around this? please dont say make a confirmation page that says thier logged in. if i had control over those auth systems i would have done that 8 hours ago.

thanks for any help you can provide.

i cant really post the script here cause it wouldnt work without you being able to access some internal servers to get the right ini files. but here are the parts that open the pages and fill in the form.

if $externallogin == "no" then 
; Create a browser window and navigate to tool
    $oIE = _IECreate ($url)
; Create a browser window and navigate to tool
    $oIE = _IECreate ($url)

; get pointers to the login form and username, password and signin fields
    $o_form = _IEFormGetObjByName ($oIE, $formname)
    $o_login = _IEFormElementGetObjByName ($o_form, $form_username)
    $o_password = _IEFormElementGetObjByName ($o_form, $form_pass)
    $o_signin = _IEFormElementGetObjByName ($o_form, $form_submit)

; Set field values and submit the form
    _IEFormElementSetValue ($o_login, $username)
    _IEFormElementSetValue ($o_password, $password)
    _IEAction ($o_signin, "click")
    _IEFormSubmit ($o_Form)

it does work, in fact its amazing and works really great, but gets stuck on the tools that use that system that redirects you immediatly after logging in to a different domain.

Share this post

Link to post
Share on other sites

Try making this small change and see if it helps.

_IEFormSubmit($o_form, 0)


you rock!!!.

;(insert banana dance here)

figures if i spent all day on it, the solution would super simple.

i put the suggested code in place and it works like i intended it to.

thanks again for your help.

on another note, ill be sure to post here a little faster next time before i spend 8 hours beating my head on a wall.

Share this post

Link to post
Share on other sites

Hi, let me use this same thread to make my question.

I'm using IE functions to access a https URL and before accessing the URL an ALERT message box is automatically opened by IE.

What's the simplest and best way to detect this box and accept to continue with the code execution?

I use this, but I don't like too much because of mouse movement.

Is there any elegant IE function to do this?

winwait("name of alert window")


Share this post

Link to post
Share on other sites

Shesh, this is the second time in a week that someone has piled onto an existing, unrelated thread with this question.

Hi, let me use this same thread to make my question.

I don't think so. There are some other threads out there that discuss this and you might find them by searching for the words focus, send, controlsend, adlib If not, please start a new thread so that others can find the question and answer when it is available.



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

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...