Interacting with a Canvas with Selenium

后端 未结 2 1828
无人共我
无人共我 2021-01-05 03:46

I\'ve done a bit of reading on this, but haven\'t been able to find something specific. I have a canvas object that I need to interact with, with Selenium. However as we all

2条回答
  •  旧巷少年郎
    2021-01-05 04:17

    I was also looking into the same issue, after searching for some time I understood that Selenium accesses canvas element. but it can't access the inner elements/child elements of it. Because selenium used DOM model and canvas's child elements wont visible in DOM. After looking into one example mentioned here, we can interact with the canvas using coordinates. But that's absurd, most of the times we will draw elements dynamically, and how can we get perticular shape's coordinates. If you are having coordinates of the shapes you can play with them using above link.

提交回复
热议问题