Sign in to follow this  
Followers 0
aviaf

Clicking on a javascript button

5 posts in this topic

Ok, So I've used autoit here and there over the past two years, but I get confused when looking even at the help file or at other exmples for things like the IEAction.

I'm trying to get autoit to click on a button which uses javascript in the page.

This is the info about the button :

<input type="button" onclick="return SubmitTheForm();" value="Continue" name="mybutton">

What do I enter into my autoit script to click on that button no matter where it appears on the screen?

Sorry, I know this must seem like a simple question but I can't figure out what to put in.

Also, I'm confused by the example saying:

#include <IE.au3>

$oIE = _IE_Example ("form")

$oSubmit = _IEGetObjByName ($oIE, "submitExample")

_IEAction ($oSubmit, "click")

_IELoadWait ($oIE)

Should _IE_Example be replaced by my Title of my browser page? What else changes to what?

uhh, any help would be great.

Thanks.

Share this post


Link to post
Share on other sites



ok, so now i've done this:

WinWaitActive("[CLASS:IEFrame]")

#include <IE.au3>

$oIE = _IEAttach ("FIPPA Notice - Windows Internet Explorer")

$oForm = _IEGetObjByName ($oiE, "mybutton")

_IEAction ($oForm, "click")

But now it tells me that :

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Error from function _IEGetObjByName, $_IEStatus_InvalidDataType

--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType

>Exit code: 0 Time: 2.532

Share this post


Link to post
Share on other sites

ok, so rather than use the tile of the page, i used the text method using the first bit of text in the page to get ie attach to work, but why didn't it work with using the title?

Share this post


Link to post
Share on other sites

ok, so aside from the question above of why I can't use the title of the page in ieattach properly, i did figure out how to click the button on the existing page. but now i have another javascript question:

There is a new list of javascript items, and the item I want to click on does not have a simple name like the one above which had "mybutton"

Here is the info on the list item:

<TR><TD VALIGN="TOP" CLASS="x12"><LI><A STYLE="text-decoration:none;color: #800000;font: 10pt Helvetica Condensed; font-weight: bold;" href="javascript:void(0)" onclick="submitFormWin('H002','MW1','mugsi')">SOLAR

and other tabel/list options also have a class of "x12"

Share this post


Link to post
Share on other sites

Yes!

I got it to work with the ieclickbyindex!

So glad I got it working, and although I didn't get any replies here, it actually helped to post here and think it out. Plus all the other examples on the site helped too.

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