我正在尝试执行以下代码:
((JavascriptExecutor) driver).executeScript("window.getVoteX1 = function() {" +
" if (dia === undefined) dia = null;" +
" this.diagram = dia;"+
" }");
String testScript = (String)((JavascriptExecutor) driver).executeScript(" getVoteX1()");
但是出现错误:dia is not defined
我已从此处复制了javascript函数:https://gojs.net/latest/extensions/Robot.js
我下载了 JS ,并将它放在 SRC 文件夹中,但是没有运气。