I am using WebRecorder. I am trying to add some script to click on an image. The image tag looks like this:
I want to be able to simulate a click on this image. I want the simulated click to make a call to the onclick event handler. I have written this code which does not appear to generate the call to the onclick event handler.
// click on the goto button
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"./goto.png"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,IMG,SRC,str:TagValue
Any ideas on what I can do to make this work. I have been able to use similar code to get click events sent to a TD tag.
Thanks, Leo
Cannot get ClickTag to work on a IMG
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
That code looks fine to me. Not sure why it won't work. Are you able to send me the URL of the page and your full script?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Thanks for the quick response. Here is the code:
// Generated by MacroScript WebRecorder 1.64
// Recorded on Monday, January 9, 2006, at 07:34 PM
LibLoad>%SCRIPT_DIR%\IEAuto.DLL,hIE
If>hIE=0
MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
Goto>end_script
EndIf
//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1
LibFunc>hIE,CreateIE,IE[0],0
LibFunc>hIE,Navigate,r,%IE[0]%,http://...
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
// click on the AllRight SysAdmin user
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"AllRights SySAdmin"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,TD,TEXT,str:TagValue
// click on the goto button
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"./goto.png"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,IMG,SRC,str:TagValue
Message>AllRights SySAdmin user selected and goto button clicked
Wait>delay
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
LibFree>hIE
Label>end_script
I will send you the URL in a separate email - the URL is too sensitive to post here.
// Generated by MacroScript WebRecorder 1.64
// Recorded on Monday, January 9, 2006, at 07:34 PM
LibLoad>%SCRIPT_DIR%\IEAuto.DLL,hIE
If>hIE=0
MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
Goto>end_script
EndIf
//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1
LibFunc>hIE,CreateIE,IE[0],0
LibFunc>hIE,Navigate,r,%IE[0]%,http://...
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
// click on the AllRight SysAdmin user
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"AllRights SySAdmin"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,TD,TEXT,str:TagValue
// click on the goto button
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"./goto.png"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,IMG,SRC,str:TagValue
Message>AllRights SySAdmin user selected and goto button clicked
Wait>delay
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay
LibFree>hIE
Label>end_script
I will send you the URL in a separate email - the URL is too sensitive to post here.
Last edited by leolucas on Tue Jan 10, 2006 5:57 pm, edited 1 time in total.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I see the problem. You need the full absolute SRC of the IMG. Do this:
// click on the goto button
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"http://xxx.xxx.xxx.xxx/BackDoor/goto.png"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,IMG,SRC,str:TagValue
Replace xxx.xxx.xxx.xxx with the server domain or IP address. That works fine. The HREFs and SRCs are converted to and stored as absolute paths inside IE. So to match we must pass them as absolute paths.
// click on the goto button
Let>FrameName={""}
Let>FormName={""}
Let>TagValue={"http://xxx.xxx.xxx.xxx/BackDoor/goto.png"}
LibFunc>hIE,ClickTag,r,%IE[0]%,str:FrameName,str:FormName,IMG,SRC,str:TagValue
Replace xxx.xxx.xxx.xxx with the server domain or IP address. That works fine. The HREFs and SRCs are converted to and stored as absolute paths inside IE. So to match we must pass them as absolute paths.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?