Can you provide an example of how to use sMaskFile when using the Verify Bitmap method?
If you want to use the Verify Bitmap method to verify the entire window, but a section of the window is going to change all the time.
For example, there is a date/time field which is going to change all the time. How do I handle this, because if the date/time is going to
change then the verification will fail as the baseline bitmap is now different.
Use the sMask file optional argument (see the SilkTest help for more details)
- First you would record a testcase/actions, then press Ctrl + Alt on your screen, select the "Bitmap" tab and ensure that entire window is checked. Copy your testcase/actions into a script file.
- Open the bitmap tool (Start, Programs, SilkTest, Other Tools, SilkTest Bitmap Tool)
- Open the bitmap that you have just recorded. The path will be in noted in the information you just pasted into the script file.
- Go to Edit > New Mask. In your baseline bitmap draw around the section of the window that is going to change (date/time field). You will notice that a black rectangle appears in your mask file. Save this file.
- To handle this in your code see the example below:
[-] testcase Test1 () [ ] WelcomeToGreenMountainOutp.SetActive( ) [ ] WelcomeToGreenMountainOutp.VerifyBitmap ("F:\Program Files\Segue\SilkTest\Projects\VerifyBitmapMask\bitmap.bmp", NULL , "F:\Program Files\Segue\SilkTest\Projects\VerifyBitmapMask\mask.bmp")
NB: The NULL value is present because there is another optional argument that you can use called Rect, see the SilkTest Help for more details on this argument.