Automate Lightning Charts

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Queue Moderators

Post Reply
KARZONE
Posts: 2
Joined: Wed Jan 27, 2016 6:14 am

Automate Lightning Charts

Post by KARZONE » Wed Jan 27, 2016 6:19 am

Hi,

We are currently using a Desktop based application, which involves lightning charts controls, which is a primary functionality in our application. And we are currently in the process of automating the lightning charts functionality.

Could you please advice, or suggest any automation tools, which supports automation of lightning charts. Or Do you provide any kind of support for automating the lightning charts. Your suggestions are much appreciated.

Thank you in advance,
Regards,
Karthick K

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Automate Lightning Charts

Post by ArctionPasi » Thu Jan 28, 2016 4:52 pm

Hello,

Now, I'm not sure what kind of automation software support are you looking for. Automated testing / UI testing / connecting to automation systems like Scada / HMI / LabView ?

LC provides a normal.NET API, but we haven't especially made support for any 3rd party tool.
LightningChart Support Team, PT

KARZONE
Posts: 2
Joined: Wed Jan 27, 2016 6:14 am

Re: Automate Lightning Charts

Post by KARZONE » Mon Feb 01, 2016 9:23 am

Hi,

Thanks for the reply.
We are looking for some automation tool, that would support the Lightning Chart controls. We are trying to automate the testing of Lightning Charts, and it would be of great help, if you could suggest any automation tool which supports the lightning charts. Or Do you own any Third party tool (or) Automation software which supports the Lightning Chart controls.

Regards,
Karthick K

mat-d
Posts: 19
Joined: Sat Jun 26, 2021 4:27 am

Re: Automate Lightning Charts

Post by mat-d » Sat Oct 29, 2022 3:52 am

Hello,
I'm currently stuck on the same problem.
We're trying to write integration tests for a winforms desktop application.

Tools such as Inspect.exe in the Window SDK can be used to interact with user interfaces, this can be used to drive a ui and interrogate values to compare to expected values for automated tests.

https://developer.microsoft.com/en-us/w ... ndows-sdk/

While other controls typically reveal information about their state, lightning chart controls are just a black box that return only:

- Other Props: Object has no additional properties
- Children: Container has no children

Does Arction perform automated tests on your charts? If so can I ask what approach you take as we are hitting a brick wall.

Thanks

Mat

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Automate Lightning Charts

Post by ArctionKestutis » Mon Oct 31, 2022 2:15 pm

What would be your idea behind automated testing? In particular, what are the reference values (you want to compare to) and what are the inputs (mouse click, data sets etc.)?

At the end of the day, chart is the image - produced by LightningChart rendering. Most of the automated test I am aware is build around this concept. That it, you create reference image and compare it with your test results. The difficulty of this approach is what you would need to remove any degree of freedom in rendering. In particular, you could not allow any auto-rendering (auto-margins, auto-ticks calculations, auto-title positioning etc.), because any small changes in library or in the code could produce different image (from pixel by pixel comparison perspective).

You could write unit testing in Visual Studio or simple .NET app to access Chart properties and export image. That is probably not only way of testing. But I don't see how reading properties alone would help you.

Hope this helps.
All the best.

mat-d
Posts: 19
Joined: Sat Jun 26, 2021 4:27 am

Re: Automate Lightning Charts

Post by mat-d » Wed Nov 02, 2022 4:03 am

Hello Kestutis,


Reading values from the charts would be useful for end to end tests of release versions of complied applications.

We could send data to a serial port connection and user events to the user interface, and see how long it takes for data points to show up on the charts. If we can then identify where those points are we can then test hover behaviour.

We have similar tests that inspect numerical displays, it's convenient being able to define these test programmatically.


We are implementing image based tests, but as you've indicated, this requires reference images, and tests that use an image diff are very brittle. Tests of hover behavior are even more difficult as we need to know the exact mouse coordinates to trigger the behaviour.

We'll continue with image tests for now, Thanks for taking the time to respond to my questions

Regards

Mat

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Automate Lightning Charts

Post by ArctionKestutis » Wed Nov 02, 2022 2:18 pm

I don't know that is missing for Inspect.exe in the Window SDK - why only single pane shown instead of Chart's properties. However, in principle LightningChart has 1500+ properties and 150+ events, which could be used in testing.

As I mentioned before, all those properties and event could be used unit testing in Visual Studio or used to do some logs in .NET app itself.

Here is a little bit of concept behind LightningChart .NET control.
Every property or series data value change will cause the LightningChart control to be redrawn. If more than one property is programmatically changed at the same time, the property changes should be made between BeginUpdate() and EndUpdate() method calls, as a batch. BeginUpdate() will stop drawing the control until EndUpdate() is called.
When chart is redrawn/rendered, Chart.AfterRendering event is fired. Event handler could be used to record timing and read any of properties. In addition, Chart image could be save from stream or using any other exporting functionality.
To read user interaction on chart there are numerous event handlers. Starting from general Chart.MouseClick, MouseMove etc., when more specific View events like Chart.ViewXY.Zoomed, BeforePanning etc., and very special per object events like Series.MouseOverOn, LegendBox.DraggedByUser etc.
.NET provides method to read mouse coordinates above the Chart, while Axis calls has methods to convert between screen coordinates and axis values (and vice versa).

Hope this helps.

mat-d
Posts: 19
Joined: Sat Jun 26, 2021 4:27 am

Re: Automate Lightning Charts

Post by mat-d » Mon Nov 07, 2022 11:22 pm

Hello Kestutis,

I understand how these could be useful approaches for writing unit tests.
I'm not sure if I'm missing something here, I didn't think it was possible to detect these events via inspect.exe?

Thanks

Mat

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Automate Lightning Charts

Post by ArctionKestutis » Tue Nov 08, 2022 9:35 am

It is not possible to 'see' Lightningchart properties through via inspect.exe.

mat-d
Posts: 19
Joined: Sat Jun 26, 2021 4:27 am

Re: Automate Lightning Charts

Post by mat-d » Tue Nov 08, 2022 9:48 am

Thanks Kestutis

Post Reply