SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Guest

    CaptureBitmap method: Getting exception Bitmap not stable

    According to the language reference book, one should be able to pre-select a range of text when getting exception Bitmap not stable message.

    How do I go about pre-selecting a range of text?

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: CaptureBitmap method: Getting exception Bitmap not stable

    YMK, it is very good to hear from you in your new job !
    Good to hear that you are moving more into the automated side of testing !
    Welcome to the QA forums !

    To start, I should warn you that using bitmaps in automated tests is almost always a very bad idea.
    The tests that you create will require a lot of maintenance and QA will become a major bottleneck
    in the software development cycle at your company.
    Our last job is an excellent example of the end result of this :-)
    One of the problems with SilkTest bitmaps is that if you create a test with your display set to a color
    depth of say, 65536 colors, the test will fail if it is run with any other color depth setting.

    Now to answer your question:
    The "Bitmap not stable" error means that the appearance of the window is changing continuously.

    Normally, CaptureBitmap() waits for the appearance of a window to become constant (or "stable")
    before it completes its capture. Otherwise, when the test runs very quickly, it may capture bitmaps
    from windows that have not completely refreshed themselves.

    Often this fails, however, because something in the window that is constantly changing.
    This could be something as simple as a blinking vertical cursor bar in the text. (this is a common culprit)

    The first thing you need to do is to visually determine what it is that is changing.
    If it is a blinking cursor, there are two simple ways to deal with it:
    1. Have the test do something that gets rid of the cursor (set another control active).
    2. Adjust the Agent options for bitmaps so that the cursor is ignored.
    (i.e. if the cursor contains 30 pixels, then set OPT_BITMAP_PIXEL_TOLERANCE to 30 or more)

    There are other creative ways you can manipulate the Agent options to deal with this. From SilkTest help:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>
    Bitmap Agent options
    Various bitmap options determine bitmap verification behavior:

    Option Description
    OPT_BITMAP_MATCH_COUNT The number of successive snapshots that must be the same for the bitmap to be considered stable.
    OPT_BITMAP_MATCH_INTERVAL The time interval between snapshots to use for ensuring the stability of the image.
    OPT_BITMAP_MATCH_TIMEOUT The total time allowed for a bitmap to become stable
    OPT_BITMAP_PIXEL_TOLERANCE The number of pixels of difference below which two bitmaps are judged equivalent.
    <HR></BLOCKQUOTE>

    If the blinking area is bigger than a cursor, then you might need to designate a "capture region" in
    your window. I think that this is what you are refering to in your question. Unfortunately, the capture
    region is a simple rectangle designated by pixel coordinates, not by character locations in your text.

    From SilkTest help:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>
    CaptureBitmap method
    Saves a bitmap image to a file.

    Syntax
    window.CaptureBitmap (sBitmapFile [, Rect])

    Where:
    sBitmapFile The name of the file to save the bitmap to. STRING.
    Rect Optional. The coordinates for the capture region, relative to the window.
    If you omit Rect, CaptureBitmap captures the entire window. RECT.
    <HR></BLOCKQUOTE>

    There is yet one other technique that you can use. That is to create a "mask" file for your bitmap.
    CaptureBitmap() does not support masks, but the other bitmap functions do.
    Read SilkTest help to learn how to do this.

    -Rob
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:39 PM.

Copyright BetaSoft Inc.