I am working in an online CRM that uses dynamically generated pages containing javascript.
When I click on a customer's name it opens that customer's record with our company.
One of the tabs on the record page is "Recent Activities".
When I click on the Recent Activities tab a table with information generated using javascript comes up.
Sometimes the table generated can contain anything from 1 line to 20 lines, etc.
To the LEFT of each record is a Reddish colored "Edit" image.
THIS is where the problem begins:
I created a script that finds each of these Edit images in the table and opens a page and scrapes data.
Thanks to Dorian, this script works fine.
The problem now is that each time the table generates and the macro starts over it can't find the Reddish Edit button even though it appears in the EXACT same place. The table ALWAYS generates in the same place.
To the naked eye the Edit button appears exactly the same.
-I have used MDL>%RedFound% to see what the count is and even though there are obviously a number of Edit images on the screen the MDL comes back with "0".
-I have used delays to let to give the script more time to look at the page.
-I have defined a smaller rectangle for the script to focus on in case there were too many similar images confusing it. Still nothing.
-I have used the Image Recognition Wizard to capture the image again and it still doesn't find it.
If anyone has encountered this issue before or knows how to solve it I would appreciate the help.
I have included my script below.
Thanks,
rjw524
Code: Select all
//FIND RED EDIT IMAGES
ScreenCapture>39,536,462,1006,%TEMP_DIR%\screenrect.bmp
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_41.bmp,%TEMP_DIR%\screenrect.bmp,0.7,1,XRed,YRed,RedFound,EXACT
Wait 2.0
If>RedFound=0
Wait 1.0
Goto FindEdit
MouseMove>{%XRed_0%+39},{%YRed_0%+536}
LClick
Else
wait>1.0
Let>k=0
Repeat>k
Wait 0.1
MouseMove>{%XRed_0%+39},{%YRed_0%+536}
wait 0.1
GetCursorPos>X,Y
wait 0.1
MouseMove>{%X%-25},{%Y%+0}
wait 0.1
LDown
wait 0.1
GetCursorPos>X,Y
Wait 0.1
MouseMove>{%X%+1630},{%Y%+0}
wait 0.1
LUp
wait 0.1
Press CTRL
Send c
Release CTRL
wait 0.1
LClick
Wait 0.1
GetCursorPos>X,Y
MouseMove>{%X%-1605},{%Y%+0}
wait>0.1
//PASTE ACTIVITY IN EXCEL
SetFocus>Excel*
Wait 0.1
Press CTRL
Send v
Release CTRL
wait 0.1
SetFocus>Microsoft Edge*
Wait 1.0
Let>k=k+1
Until>k={%RedFound%}
EndIf
Wait 1.0