Sign in to follow this  
Followers 0
styles3000

Clicking Buttons In IE

8 posts in this topic




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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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... >_<

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Similar questions in details in parameter of "ControlClick": "[CLASS:Button; TEXT:OK; Instance:1;]"?

Edited by Avatar007

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  
Followers 0