I automated this using the "IE Element Wizard", which produced:
Code: Select all
IEClickTag>%IE[0]%,{""},{""},{"IMG"},{"ID"},{"PT Portfolio Landing Page_IMG"},ie_res
To overcome this I used the "Image Recognition Wizard", which I think should solve all the problems.
The image is found and the mouse pointer moves to the correct position, but the following LClick does not click.
Note that the mouse pointer is a "hand" and not a "pointer", a possible reason?
A full test script is as follows, image_1.bmp needs to be recreated.
Code: Select all
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
// Generated by MacroScript WebRecorder 4.04
// Recorded on Thursday, March 15, 2018, at 04:15 PM
//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1
//Set timeout for ClickTag and FormFill to 10 seconds, increase if pages load more slowly
IESetTimeout>10,ie_res
IECreate>IE[0]
IENavigate>%IE[0]%,https://shareinvesting.anz.com/Home.aspx,ie_res
IEWaitDocumentComplete>%IE[0]%,ie_res
WindowAction>1,ANZ Share Investing | Online Share Trading - Internet Explorer
/* Click within IEClickTag works but unreliable as the number of images on web page changes
IEClickTag>%IE[0]%,{""},{""},{"IMG"},{"ID"},{"PT Portfolio Landing Page_IMG"},ie_res
*/
// LClick does not work
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
IEWaitDocumentComplete>%IE[0]%,ie_res