Testing Bar Charts and Pie Charts

Ranorex Studio, Spy, Recorder, and Driver.
nandeesh
Posts: 14
Joined: Tue Jun 12, 2012 12:07 pm

Testing Bar Charts and Pie Charts

Post by nandeesh » Tue Jun 12, 2012 12:13 pm

Hi,

How to test the dynamically generated pie and bar charts in java swing application ?
and how to validate them....? I am using C# for coding.
appreciate your replies...

Thanks.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Testing Bar Charts and Pie Charts

Post by Support Team » Tue Jun 12, 2012 3:59 pm

Hi,

You can for instance use one of our search methods to get them during runtime.
For a more detailed answer we would need more detailed information about the dynamically generated elements and how your tests are structured.
A Ranorex Snapshot File would also be helpful.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files

Regards,
Markus
Ranorex Support Team

nandeesh
Posts: 14
Joined: Tue Jun 12, 2012 12:07 pm

Re: Testing Bar Charts and Pie Charts

Post by nandeesh » Wed Jun 13, 2012 8:15 am

Hi Markus,
Thanks for Reply..

A Java swing app is generating pie or bar charts according user selection from the database data. I can successfully compare two static images. since i cant store dynamic images in repository, so i am comparing database data itself. but is there any option that i can validate dynamic pie or bar charts(example just graphs of any stocks).

I am trying to compare the stream of dynamically generating chart images.
Regards,
Nandeesh

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Testing Bar Charts and Pie Charts

Post by Support Team » Wed Jun 13, 2012 12:01 pm

Hi,

basically, you can capture a dynamic screenshot via user code.
So, if you have a diagram1 and a diagram2 in your repository, you can compare these diagrams with user code similar to following:
// capture image holding diagram1
Bitmap bmp = repo.form.diagram1.CaptureCompressedImage();
// create Findoptions with similarity set to 95%
Imaging.FindOptions myFindOptions = new Imaging.FindOptions(0.95);
// compare previous captured image holding diagram1 with image holding diagram2
Validate.CompareImage(repo.form.diagram1, bmp, myFindOptions);
For further detaisl about user code actions and user code modules please have a look at following chapters of our user guide:
User Code Actions
User Code Modules

Regards,
Tobias
Ranorex Team

nandeesh
Posts: 14
Joined: Tue Jun 12, 2012 12:07 pm

Re: Testing Bar Charts and Pie Charts

Post by nandeesh » Wed Jun 13, 2012 12:49 pm

Hi Tobias,

Thanks...