Jump to content

Clicking Buttons In IE


Recommended Posts

How would I construct a mouseclick using these this info from the info tool?

_IEAction("Internet Explorer_Server1","313,195")

or should I do this _IEAction("CLASS:Internet Explorer_Server;INSTANCE:1","313,195")

What To Use.pdf

RTFM.

Try any of the following:

_IEAction()

_IELinkClickBy*()

Cheers,

Brett

Link to comment
Share on other sites

The help file doesn't get very detailed with explaining this function.....

#include <IE.au3> 
_IEAction ( ByRef $o_object, $s_action )

could someone fill me in on what "ByRef $o_object " is? I know its an Object variable of an InternetExplorer.Application. But what do I reference to get the click that i want?

Link to comment
Share on other sites

Check the _IECreate example:

#include <IE.au3>
$oIE = _IECreate ("www.autoitscript.com")

$oIE is the object of the IE . Then you can use something like:

$oSubmit = _IEGetObjByName ($oIE, "submitExample")
_IEAction ($oSubmit, "click")
Edited by Juvigy
Link to comment
Share on other sites

Hang on, the example(s in this case) for the function aren't detailed?

; *******************************************************
; Example 1 - Open a browser with the "form" example, get a reference
;               to the submit button by name and "click" it. This technique
;               of submitting forms is useful because many forms rely on Javascript
;               code and "onclick" events on their submit button making _IEFormSubmit()
;               not perform as expected
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
$oSubmit = _IEGetObjByName ($oIE, "submitExample")
_IEAction ($oSubmit, "click")
_IELoadWait ($oIE)

; *******************************************************
; Example 2 - Same as Example 1, except instead of using click, give the element focus
;               and then use ControlSend to send Enter.  Use this technique when the
;               browser-side scripting associated with a click action prevents control
;               from being automatically returned to your code.
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
$oSubmit = _IEGetObjByName ($oIE, "submitExample")
$hwnd = _IEPropertyGet($oIE, "hwnd")
_IEAction ($oSubmit, "focus")
ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")

; Wait for Alert window, then click on OK
WinWait("Windows Internet Explorer", "ExampleFormSubmitted")
ControlClick("Windows Internet Explorer", "ExampleFormSubmitted", "[CLASS:Button; TEXT:OK; Instance:1;]")
_IELoadWait ($oIE)

Wait how isn't it detailed? You know what the parameters are, there are the variables, but two and two together, search through the help file... >_<

Link to comment
Share on other sites

  • 6 months later...

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