Cesium interaction with Selenium for automated UI testing

Hello! I’m a test automation engineer working on automating User Interface-level function, regression, and integration tests for an application that uses Cesium to display graphical map data. Our automation framework consists of Python scripts with custom wrappers that utilize the Selenium library. We have had very little success getting Selenium to interact with Cesium. Our element selectors are mostly XPATH and CSS based, but the Cesium map doesn’t appear to have any interactable elements on the DOM. I was wondering if anyone here could shed some light on the subject: is there a good way to get Selenium to interact with Cesium for automated testing purposes?

Hi @trevor.judd, thanks for the question!

The CesiumJS viewer is rendered using WebGL in a single canvas element which, as you discovered, currently doesn’t expose the API through the DOM. I’m not familiar with Selenium but if you’re able to get into the js context for the test page you might be able to interact with the CesiumJS API and manipulate the scene that way.

We use a mixture of playwright and karma to run our tests but that’s all in JS not python. Feel free to look through our Testing guide for how we have things set up.

I’m not sure if that answers your question but hopefully hit’s a helpful start? Maybe you can share more info about the types of tests you’re trying to set up and we can brainstorm more.