Forum Discussion

mjohnsen's avatar
mjohnsen
New Contributor
12 years ago

How to retrieve the actual image from a Region Checkpoint

Hi,



I have a KeyworkTest containing several Region Checkpoints which compares gui images with a set of baseline imges in Stores-Regions. When running the test, I want to retrieve the set of actual images in a specific folder and give the images specific names.



I can export the log file with all log images, including the actual gui images. But then I have to identify the actual images among all these files and manually rename and move them to another folder.



I have converted the KeywordTest to java script and tried this:



Regions.theStoreRegionName.Check(theUIpicture);  //converted from the keyword test

pic = theUIpicture;

pic.SaveToFile(aPngFolderAndFileName);



But this does not work, there is no file created in the folder.

The folder name is correct, I tested this by adding code to create the file. 

Also, the actual image is seen in the log and when exporting the log.



Help is much appreciated!:-) Thanks!
  • karkadil's avatar
    karkadil
    Valued Contributor
    You don't need Regions at all. To save actual image of the control, just use Picture method of the control.



    var pic = Sys.Process(...).Window(...).Picture();

    pic.SaveToFile();



    As for your problem, I believe that theUIPicture in your case is an onscreen-object, not a picture object