Verify a Dynamic Chart in Selenium WebDriver
How to use automated testing on dynamically updating charts
3 min readMay 22, 2022
In a previous article, I covered how to use automated testing for SVG charts and Canvas charts. Another scenario you may want to test with charts, is dynamic charts.
Dynamic charts are charts that auto update with new information. This one below updates every 2 seconds.
Suppose you have a testing requirement to check the graph is dynamic. How could you use an automated test to verify that the chart gets updated over time?
Test Steps
- Verify the chart exists and take a snapshot
- Wait for the chart to update
- Take another snapshot of the chart
If desired, you can repeat steps 2–3 more times. - Verify the snapshots are all different
1. Verify the chart exists and take a snapshot
In my last article, I provided an example and the code to extract a snapshot of a canvas. Link below: