Chartjs-How to use Selenium with "chart.js"

0👍

You won’t be able to access the chart directly using Selenium because there is no DOM, as you noted. There may be a way to access chart data using JavascriptExecutor to run JS commands. I’m not familiar with chart.js but I have written automation against CANVAS elements. I got with dev and talked to them about what I needed access to and they gave me pointers on methods, etc. that I could call to get what I needed. I use the page object model so I ended up writing some Java functions that wrapped around the JS code that accessed the CANVAS.

Leave a comment