Jump to content

Listening for a button click in IE


Recommended Posts

  • Moderators

I have, admittedly, not done a lot with IE Automation, so hopefully this is a case of simple ignorance on my part. I have a customer using a web app for their claims system. An employee swears they add a new note to a claim, and click the Submit button, but intermittently when the page refreshes there is no note attached. There is tracking software I have in place that gives me a pretty deep level of insight into the traffic, showing me the actual db calls, code in the different javascript functions, etc., but it is server side only. I have used a product similar to Fiddler, but the problem is so intermittent I have yet to catch it in action.

Today the customer asked if we could script something that sits on the machine and writes a time stamp to a simple log file every time the employee presses the submit button. Now, I can get the IE object by its id, and I can even click on it, but am unsure how feasible it is to listen for this action. As there are many different "submit" buttons for various actions on the different pages of a single claim, my guess is I would have to listen for and log the actual output of the invokeEvent that is called when the employee presses that particular button. Just curious if anyone has ever done something similar, and can offer suggestions on approach. Below are a screenshot, as well as the html for the button.

post-54985-0-89077600-1408998758_thumb.p

id="NewNoteWorksheet:NewNoteScreen:Update" onclick="if(!this.disabled){Events.invokeEvent('NewNoteWorksheet:NewNoteScreen:Update_act', true);}event.cancelBubble = true;; EventHandlers.clickHandler(event, true)"

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Do you try attach ObjEvent for this button and simply listen a onclick event?

$button = _IEGetObjById($oIe, 'NewNoteWorksheet:NewNoteScreen:Update')
ObjEvent($button,'button_')

Func button_onclick()
    $obj = @COM_EventObj
    ConsoleWrite($obj.id & @CRLF)
    ConsoleWrite('button_onclick' & @CRLF)
EndFunc
Edited by Inververs
Link to comment
Share on other sites

  • Moderators

I have, but it is not activating on the button. For some reason I am not even catching the button now, it is setting @error to 7 (No match). I am sure I was getting it last night, not sure why it's giving me fits this morning.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...