I've written a script for a dynamically generated webpage that brings up a different number of records depending on the customer name you click.
Customer A may only have 3 records. Customer B may have 8 records. Customer Z may have 25 and so on.
There are thousands of customers.
What doesn't change is a unique javascript "Edit" image to the left of each record.
So for Customer A there's an "Edit" image to the left of each of the 3 records. For Customer Z there's 25 "Edit" images, etc.
I need to click EACH "Edit" image to open a page and pull data from it.
I created a script that looks at the page and puts the "Edit" images in an array and is supposed to click each Edit image.
PROBLEM: My script seems to click the first "Edit" image it sees and instead of clicking the next one and the next one and so on until it's finished, it clicks the same first image over and over.
I even included a MDL>%EditFound% to see if the array itself is the problem and it isn't. It's finding multiple identical images on the page. The problem appears to be in my script and how I'm looping the loop.
IMPORTANT: Clicking each "Edit" image is the only way to get to the data I need. Unfortunately, there is no workaround.
I've included my script to see if anyone here can tell me what I did wrong in constructing the loop.
Thanks!
rjw524
Code: Select all
SetFocus>Microsoft Edge*
Label Start
Wait 1.0
//Find and Left Click Center of EDIT_IMAGE
FindImagePos>%BMP_DIR%\image_6.bmp,SCREEN,0.7,1,XArr1,YArr1,EditFound,EXACT
If>EditFound>0
Let>k=0
Repeat>k
Letk=k+1
Wait 0.05
MouseMove>XArr1_%k%,YArr1_%k%
wait 0.05
LClick
Wait 2.0
//Find and Move Mouse Middle Right of DATA1
FindImagePos>%BMP_DIR%\image_3.bmp,SCREEN,0.7,8,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Endif
Wait 2.0
//Find and Left Click Center of DATA2
FindImagePos>%BMP_DIR%\image_4.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
Wait 1.0
Until>k={%EditFound%}
EndIf