Capture Image original location

Hi
I would like to capture an image with it’s original location.
Here is my code

put (403,240,643,562) into myLocation
put (SearchType: “Tolerant”, CaptureLocation: myLocation) into CaptureInfo
CaptureScreen (Name: Mazlin, Rectangle: myLocation, ImageInfo: CaptureInfo)

I manage to capture the image with an image info file.
However when I copy it to my test suite Image folder, I could not retrieve it’s original location.
I open the SUT with the image display then I click search using the image doctor. The original location is highlighted at the top left corner of my SUT.

Thank you for your help

When specifying the CaptureLocation, you need to supply a point (two coordinates), not a rectangle. The origin function could be used here, like this:

put (403,240,643,562) into myLocation 
put (SearchType: "Tolerant", CaptureLocation: myLocation's origin) into CaptureInfo 
CaptureScreen (Name: Mazlin, Rectangle: myLocation, ImageInfo: CaptureInfo)

I would also mention that you can capture the image directly into the Images folder of your suite by supplying the full path name, like this:

set imageName to "Mazlin"
set imageFolder to my folder's folder & "Images/"
set imagePath to imageFolder & imageName

Then your capture command would look like this:

CaptureScreen (Name:imagePath, Rectangle: myLocation, ImageInfo: CaptureInfo)

I hope that helps! :slight_smile:

Hi

Thank you so much. It really work :mrgreen: