Coded Test Step - How do I get the bitmap from ArtOfTest.WebAii.Controls.Xaml.Wpf.Image ?

2 posts, 0 answers
  1. Chris
    Chris avatar
    4 posts
    Member since:
    Apr 2016

    Posted 25 Aug 2016 Link to this post

    In a coded test, I’m trying to compare an image displayed in a ArtOfTest.WebAii.Controls.Xaml.Wpf.Image control with an image I have on the file system. This would be quite straightforward in WPF, but how do I get the bitmap (either as a byte[] or System.Drawing.Bitmap) from ArtOfTest.WebAii.Controls.Xaml.Wpf.Image control? 


  2. Konstantin Petkov
    Konstantin Petkov avatar
    1911 posts

    Posted 30 Aug 2016 Link to this post


    There is no API or a way for the WPF testing framework to obtain the real bitmap out of the image source. However you can eventually read the bitmap manually as you do in WPF by obtaining first the image source. See this feedback on the matter. Please note however the API has been updated an year ago so you will need a newer version of the product to use the extension we've added.

    I would however look into a different approach - the built-in Image Verification feature in Test Studio. It's a straight-forward image comparison solution which you can give a try as well.

    Konstantin Petkov
    Telerik by Progress
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top