Jump to content

Clicking an input on a webpage


Recommended Posts

Hello,

I'm having trouble clicking on the following input on a webpage:

<input type='image' onmouseover='top.mess(this)' name='submit' disabled='disabled' onclick='setTimeout(\"this.disabled=true;\",10);this.style.border=\"1px solid green\";this.blur();return true;' src='images/submit.png' style='cursor: default; position: relative; left: 0; top: 0; vertical-align: bottom;'>

This input lies within a form, and the reason I want to click it is because I assume the form requires some return value from it's form elements - just submitting the form does not work.

I have no problem getting reference to the input, and have tried the following actions:

_IEAction()

_IEFormImageClick()

$oInput.click

$oInput.fireEvent("onmouseover")

$oInput.fireEvent("onclick")

All of the above work, in that they do not return any COM errors to the console, but they do not produce the desired results on the webpage. The other expected changes on the webpage (that occur when manually clicked) don't occur. Interestingly enough, using $oInput.click produces different results than _IEFormImageClick. With _IEFormImageClick, the input does have its border changed, which should mean the onclick event fired, strictly using _IEAction or the .click method doesn't cause the border change. In either case though, the other expected changes on the webpage don't occur, so the form can't have been submitted correctly.

My question is, how do I troubleshoot further? I believe the form is requesting some other values that I'm not supplying with the script, but that are there with the manual click. Where do I look for more information about what's happening with the input?

Thanks in advance.

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

It is possible that the script tied to onmouseover triggers something... you can try to explicitly fire the onmouseover event, but it can actually also read mouse coordinates with the 'evt' object... so, you may also wnat to try using _IEPropertyGet to get the coordinated of the button and position the mouse over it with mousemove. Only way to know is to try it or to dig into the javascript (DebugBar makes that relatively easy).

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

I forgot to mention that I tried keeping the mouse over the button while using _IEFormImageClick and straight .click - there's no difference to the end result if the mouse is there or not. The only additional info I found in DebugBar was the following function:

function mess(ele){return true;}

Is there something else I can look at to provide more information? How do I find out what the form/scripts are looking for?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

Just not enough info to speculate. The issue is most certainly in some burried javasctipt... but then again, I really don't have enough info to know what is happening and what is expected. It may take a reproducer or access to the site.

You can also try _IEAction focus and then SEND enter.

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

Let me see what I can come up with for a reproducer then.

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
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...