Sign in to follow this  
Followers 0
bundyxc

Clicking text (connected to javascript)

4 posts in this topic

I'm automating a web task, and need to click this:

<button class="action" tabindex="503">Update</button>

As you can see, it isn't a link, it doesn't have an ID, or a name. Any ideas on how to click it?


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites



Look at the _IE* functions in the help file. You can get the collection of buttons by _IETagNameGetCollection($oForm, "button") and then loop through the collection looking for $oButton.tabIndex = 503 and/or $oButton.innerText = "Update". Once you find it, you would click it with _IEAction($oButton, "click").

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Alright, so how would I loop through the collection?

$update_submit = _IETagNameGetCollection ($browser, "button")
_IEAction($update_submit,"click")

Throws this error:

C:\Program Files\AutoIt3\Include\IE.au3 (2795) : ==> The requested action with this object has failed.:
$o_object.Click()
$o_object.Click()^ ERROR
>Exit code: 1    Time: 11.027

Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites

Alright, so how would I loop through the collection?

$update_submit = _IETagNameGetCollection ($browser, "button")
_IEAction($update_submit,"click")

Throws this error:

C:\Program Files\AutoIt3\Include\IE.au3 (2795) : ==> The requested action with this object has failed.:
$o_object.Click()
$o_object.Click()^ ERROR
>Exit code: 1    Time: 11.027
Look at the example script under _IETagNameGetCollection() in the help file. Notice the For/In/Next loop for walking through the collection one object at a time ($oInput in the example). In your loop, you want to test each one until you find the right one (as I described earlier), then do your "click" and exit the loop.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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