Forum Discussion

nbenitus's avatar
nbenitus
Contributor
13 years ago

How to create mask on existing Regions file

Hi,



I have an existing screenshot and I would like to create a mask on it. How do I that?



I know it's possible to add a mask when you create the screenshot, but is it possible to add a mask to an existing screenshot?



Thanks in advance!



Benoit

4 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Benoit,


    You can create a mask for the region checkpoint in any graphical editor (for example, Microsoft Paint). For this purpose, do the following:

    1. Open your file in the editor.

    2. Fill the areas you want to include into the comparison with the white color.

    3. Fill the areas you want to exclude from the comparison with the black color.

    4. Save the image as a Monochrome Bitmap image.

    5. Add the created mask to the Regions collection of your TestComplete project.

    6. Specify the created Stores item as a mask when you create Region checkpoints.


    I hope this information helps :)

  • I am a bit confused.



    How does TestComplete know that an image has a mask?



    Is it only because there's another image with name <image_mask.bmp>?



    Is it because of something else? Can the mask be linked to the image only when creating a screenshot?
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Benoit,


    How does TestComplete know that an image has a mask?


    If you specify the Stores item as a mask when you create Region checkpoints, TestComplete will treat this item as a mask for the compared image. If you just create the image with the name you mentioned and save it to the Stores collection, TestComplete won't automatically link it to an appropriate image and won't use it in the created checkpoints. In other words, you need to point out the exact mask for the checkpoint when you create it.


    For more information, please refer to the Specifying a Comparison Mask section of the Creating Region Checkpoints help topic.