Jump to content
Sign in to follow this  

IE navButton click

Recommended Posts


I'm trying to click on a button on IE but I failed to do so using IEAction and IEFormSubmit. I'm trying to click on the 'Login' button on URL: https://briefing.met.ie/login.php. Please see the source code of page below

<form id="login" action="./login-result.php" method="post">
    <div class="section">
        <div id="login_section">
                <input type="hidden" name="action" value="login"/>
                <label for="username">Username:</label>
                <input type="text" id="username" name="username" />
                <label for="password">Password:</label>
                <input type="password" id="password" name="password" />
    <div class="section">
        <input class="navButton" type="submit" value="Login" />

Is there any specific method to click on button of class navButton? Please help me.

Share this post

Link to post
Share on other sites

Sorry for not posing my code. I'm adding code below.

#include <IE.au3>
#include <INet.au3>
Global $oIE ;IE object.
Global $sURL = "https://briefing.met.ie/local.php" ;URL
Global $sUserName = "Pooja" ;Login name
Global $sPassword = "Pooja" ;Login password
$oIE = _IECreate ($sURL,1) ;Create IE
$o_form = _IEFormGetObjByName ($oIE, "login") ;login form
$o_login = _IEFormElementGetObjByName ($o_form, "username") ;Handle to UserId input
$o_password = _IEFormElementGetObjByName ($o_form, "password") ;Handle to Password input
_IEFormElementSetValue ($o_login, $sUserName) ;Set user name
_IEFormElementSetValue ($o_password, $sPassword) ;Set password
$oLoginBtn = _IEFormElementGetCollection ( $o_form , 3 ) ;Get Login button object
_IEAction ($oLoginBtn, "focus") ;Set focus on Login button => Does not work
_IEAction ($oLoginBtn, "click") ;Click the button => Does not work
_IEFormSubmit ( $o_form) ;Submit login form => Does not work
_IELoadWait ($oIE) ;Wait until page loads

Share this post

Link to post
Share on other sites

You should better define what you mean by "does not work". Also, if IE9, try putting the page in compatability mode first to see if you get a different result.


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


Dale, thank you so much. I added the site to view in compatibility mode through Tools-> Compatibility view settings and it worked.

Thanks friends for your help.



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.

  • Similar Content

    • By dannymcf2
      Im just going to say that im new to autoit and this is my first successful script !  
      anyway i have a little problem that does not
      make sense at all to me.... Maybe you can help me out? Anyone please??
      What i have the SCRIPT do is this : 
      The script finds a text box (on the screen) then it clicks the text box, then it sends "guess what...."
      but after it has sent "guess what...." FOR SOME REASON IT SCROLLS DOWN THEN ENDS THE SCRIPT WITH AN ERROR.... (see below for error...)
      "C:\Users\yolo\Desktop\bot\best.au3" (47) : ==> Illegal text at the end of statement (one statement per line).: mousewheel("down"), 3) mousewheel("down")^ ERROR HERE IS MY SCRIPT BELOW... That im having problems with.
      func ns3() $pixel = PixelSearch(416, 295, 882, 315, 0x707070) if IsArray($pixel) = true then MouseClick("left", $pixel[0], $pixel[1]) tn() EndIf EndFunc func tn() send ("guess{SPACE}what.....") sleep ($interval) sleep ($interval) findcombox() EndFunc So what happens is it searches for the text box, then if it's true then mouse click then Func tn() runs
      Then func tn sends "guess what...."
      then sleeps
      THEN IS SCROLLS DOWN AND AN ERROR COMES UP?!!?!?!? what the heck ?!
      oh BTW i have a few "Scroll func's" (See Below)
      Func scroll() mousewheel("down", 2) EndFunc func scroll3t() mousewheel("down"), 3) EndFunc func scrollup() mousewheel("up"), 20) EndFunc scroll () - scrolls twice down
      scroll3t() - scrolls 3 times
      scrollup() - YOU GUESSED IT! scrolls up
      SO?! What the heck is happening?! im so confused why it's scrolling down twice for no reason.... it's not like i have the scroll() in the tn() ??
  • Create New...