This is a migrated thread and some comments may be shown as answers.

Samples to test charts developed by kendo using Telerik testing framework

1 Answer 32 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Balasaravanan asked on 08 Oct 2013, 06:41 AM

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..

1 Answer, 1 is accepted

Sort by
Velin Koychev
Telerik team
answered on 11 Oct 2013, 06:32 AM
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. 

Velin Koychev
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
General Discussions
Asked by
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Share this question