Samples to test charts developed by kendo using Telerik testing framework

2 posts, 0 answers
  1. Balasaravanan
    Balasaravanan avatar
    1 posts
    Member since:
    Oct 2013

    Posted 08 Oct 2013 Link to this post

    Hi,

    We have developed few charts bar,line, scattered line charts using Kendo UI charts. I have downloaded Telerik testing framework 2013.01 and try to automate those Kendo Charts using VSUnitTest.

    Could you please provide some samples to verify the charts (either image comparison or directly verifying the bar/line series) using testing framework.


    Please find the attachment.
    Thank you..

  2. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 11 Oct 2013 Link to this post

    Hi Balasaravanan,

    This kind of testing is what we call "UI Testing" i.e. you are testing whether or not the UI responds to specific actions or conditions. Our official recommendation is to avoid doing UI testing because it's brittle and generally costs more (in time and complexity) then if you had done all this type of testing manually.

    We recommend focusing your automation efforts on the "business logic" e.g. can I add more than one item to my cart, does it calculate shipping correctly, does the system correctly prevent shipping to prohibited areas/territories, etc.

    If you choose this approach - Image Verification, we would recommend you to compare manually the expected and the actual image.

    You can capture an image of the browser at any point in the test and save that image to the hard drive. Here's how it looks in code:
    System.Drawing.Bitmap image = ActiveBrowser.Capture();
    image.Save("C:\\MySavedImages\\CurrentBrowser.png", System.Drawing.Imaging.ImageFormat.Png);

    Some other ways of capturing the browser state are listed in this article

    After that  if you choose to compare the two images with code, you can use one of the following methods:

    ArtOfTest.Common.CompareUtils.ImageCompare (Bitmap imageA, Bitmap imageB, Rectangle selectionArea, int tolerance)

    - performs a compare of two images and returns whether they are the same within a specific tolerance. You can also define the area within the image to compare. It returns a bool value.

    ArtOfTest.Common.CompareUtils.ImageExactCompare(Bitmap imageA, Bitmap imageB)

    -It validates whether the two images are exactly the same. Also returns a bool value.

     I hope this helps. 

    Regards,
    Velin Koychev
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top