I testing a website which has various bar/pie charts in the form of image files. I am required to validate these charts..
Now the problem is I am unable to figure out how i can go about validating a chart from a jpeg file. My client is ready to provide me with the component data ( the numbers) used to build up the charts. I read an old post here which talked about creating a chart in an excelsheet and then comparing properties. But that doesnt look like a feasible option in my case. At the end I will be able to just compare the images which Im sure will never work. I also asked if i could get the image file directly from source and then check, but it seems the charts are generated on some independent chart engine to which access is not an option.
Any suggestions or ideas? Is this even possible with qtp or do i need to look for another tool?
Have you looked at Bitmap Checkpoints? They can be used as a last resort, but only work well if your expected results don't change between runs. If you care more about the data and not the chart, you might see if your developers can find a way to embed raw data in the HTML somehow so that you can grab values without having to interpret the chart.
QTP Bitmap checkpoints are not that dynamic and hence i doubt if you would be really successful in testing this. I would still say its possible but if you are looking at running these scripts on the same/similar machines.
Ok i am unable to find any solution to this problem and now i really need to come up with one..
As for the options of embedding the data with the HTML source code or getting access to the chart engine, that is ruled out. I dont have these options.
i am attaching the Test object properties and the bar chart that i could get from spying. This is all the information that I can get from the image. I dont know how i can get individual values of the bars.
Is there any way that I can parse the image file in qtp and get the data?
Tarun : Sorry.. I dint get what you meant - running on same/similar machines ?
I suspet he meant that if you record a bitmap checkpoint on one machine, then replay that script on another machine that might have different screen resolutions, or theme colors, etc., your checkpoint will fail even if the data is good - it will fail because the different resolution or different color makes an otherwise valid image appear different than the one recorded in the checkpoint.
As for answering your dilemma, I have a similar need here at my place of employment.
We're testing software that displays foreign exchange rates in real time. One thing we would like to test is the charting tools this software provides.
To do this, our solution is to point our application at some preset dummy data, run the test and take a snapshot of the screen at a certain point to form our baseline, then use bitmap comparisons during future playbacks to see if the carting tools provide the same image as the baseline snapshot.
Logistically, it's an ugly solution. But it works, assuming you can control the data that makes up your chart, and you can time your snapshot of the chart in real time to the same real time you will see during playback, and assuming you run the script on the same machine all the time to avoid setting issues on different mashines.