Jump to content
Sign in to follow this  
JLogan3o13

Listening for a button click in IE

Recommended Posts

JLogan3o13

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)"

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Inververs

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

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

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  

×