Why does SilkTest CaptureBitmap() give a "Bitmap did not stabilize" error?
The CaptureBitmap() method captures consecutive bitmaps until a number of them all match, thus ensuring that the captured bitmap is "stable"or has finished rendering to the screen. Dependent on the performance of the machine this can lead to the problem, that the bitmap does not stabilize (due to permanently changing portions of the desktop). Sometimes a portion of a window is constantly changing, therefore CaptureBitmap() will always give a "Bitmap did not stabilize" error. Below are some approaches to working around this problem.
1) If an outer part of the window, which can be excluded is constantly changing, you can call CaptureBitmap using the following syntax, for example:
(sBitmapDir = window.CaptureBitmap (sBitmapFile [, Rect])),
and exclude the changing portion of the window by specifying the coordinates to capture with the argument Rect, which is of the RECT data type. RECT is the coordinates for the capture region, relative to the window. If you omit Rect, CaptureBitmap captures the entire window. More information on this step is available in the SilkTest Help file.
2) If only a small portion of the window changes, then increase the comparison tolerance so that it is larger than the area that changes. You can do this globally from within SilkTest by going to Options | Agent | Bitmap tab and increasing "BITMAP_PIXEL_TOLERANCE (pixels)". This option can also be set in your testcase/function by calling: Agent.SetOption (OPT_BITMAP_PIXEL_TOLERANCE, ).
3) If you cannot exclude the changing portion of the window, then reduce the option BITMAP_MATCH_COUNT to 0, which is the number of consecutive bitmaps that must match, when set to 0, no bitmap matching is performed during capture. You can do this globally from within SilkTest by going to Options | Agent | Bitmap tab and setting "BITMAP_MATCH_COUNT" to 0 or from within your testcase/function by calling: Agent.SetOption (OPT_BITMAP_MATCH_COUNT, 0).
4) Change the Agent default setting for BITMAP_MATCH_INTERVAL (default is 0.1 -> e.g. set to 5 to increase the time interval between snapshots to use for ensuring the stability of the bitmap image)