Jump to content

how to use controlclick to click a button on a webpage


seco
 Share

Recommended Posts

Hi

i have a submit button tied to js code when it submited and documentation says _IEFormSubmit() fails

and the button don't have id or name

i try to use control click as in help writes liek this

Opt("WinTitleMatchMode",2)

ControlClick("my page title","","[CLASS:Button; TEXT:buttontext; Instance:1;]")

it gives me error message says "the requested action with this object has failed"

what to do now??

thanks in advance.

Link to comment
Share on other sites

Hi

i have a submit button tied to js code when it submited and documentation says _IEFormSubmit() fails

and the button don't have id or name

i try to use control click as in help writes liek this

Opt("WinTitleMatchMode",2)

ControlClick("my page title","","[CLASS:Button; TEXT:buttontext; Instance:1;]")

it gives me error message says "the requested action with this object has failed"

what to do now??

thanks in advance.

If you're getting that message from AutoIt, it is not comming from the ControlClick.

See the second example for _IEAction which walks you through doing just this...

Dale

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

Link to comment
Share on other sites

thanks for reply

how to use _IEAction to click on the submit button which has no id or name?

and the example in the help which talk about _IEAction use a submit button has a name so !!!?? any solution??

thanks.

Edited by seco
Link to comment
Share on other sites

Use either _IEFormElementGetCollection or _IETagnameGetCollection, input -- but with an index parameter to get the instance you want.

Dale

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

Link to comment
Share on other sites

thanks for reply

ok but how do i know the index of the submit button shall i count all the input tags that is inside the form ?

Yep. Source code order, start with 0 (0, 1, 2, 3 etc.). DebugBar (see my sig) may help you.

Dale

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...