简体   繁体   English

如何使用 Selenium 和 Javascript 执行器查询 Canvas?

[英]How to query the Canvas using Selenium and Javascript executor?

I like to know if its possible to automate this 'graph' which is created on the canvas, if yes, how to automate it.我想知道是否可以自动化在画布上创建的这个“图形”,如果是,如何自动化它。 I have to interact with all the elements on the 'graph or a map like thing' by clicking on an element and dragging the elements and performing other actions like getting the text, etc. Is this possible in automation using selenium with JavaScript executor, can anyone help.我必须通过单击一个元素并拖动元素并执行其他操作(例如获取文本等)来与“图形或类似地图的东西”上的所有元素进行交互。这是否可以在使用 selenium 和 JavaScript 执行器的自动化中实现,可以任何人帮助。 i already scour the internet, but didn't find anything useful or which even remotely answer the question i have.我已经在互联网上搜索过,但没有找到任何有用的东西,或者甚至远程回答我的问题。 if any one can help, please do write an answer.如果有人可以提供帮助,请写一个答案。 i cannot share the real picture due to security reasons, but this is almost the same not identical.由于安全原因,我无法分享真实图片,但这几乎相同,但不完全相同。 见下图

https://www.protractortest.org/#/api?view=ElementArrayFinder.prototype.evaluate https://www.protractortest.org/#/api?view=ElementArrayFinder.prototype.evaluate

this is what you need.这就是你所需要的。 But you need to know variable names (internal logic of the canvas) in order to retrieve data但是您需要知道变量名称(画布的内部逻辑)才能检索数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM