Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在用户扩展中调用Selenium命令(即echo)?_Javascript_Selenium Ide - Fatal编程技术网

Javascript 如何在用户扩展中调用Selenium命令(即echo)?

Javascript 如何在用户扩展中调用Selenium命令(即echo)?,javascript,selenium-ide,Javascript,Selenium Ide,在使用Selenium用户扩展时,如何调用Selenium命令? 调试Selenium用户扩展时,如何回显/console.log 可以在internet上找到答案,所以我在下面发布我自己的答案要在user-extension.js中调用Selenium命令,需要使用以下语法 this.doCommandName(param) 我打电话给echo Selenium.prototype.doMyFunction = function(){ this.doEcho("This info

在使用Selenium用户扩展时,如何调用Selenium命令? 调试Selenium用户扩展时,如何回显/console.log


可以在internet上找到答案,所以我在下面发布我自己的答案

要在user-extension.js中调用Selenium命令,需要使用以下语法

this.doCommandName(param)
我打电话给echo

Selenium.prototype.doMyFunction = function(){
     this.doEcho("This info will show on logs");
}

也许这样效果更好。现在,用户扩展的调试消息与“内置”命令的调试和信息消息类似

Selenium.prototype.doYourCommand = function(strTarget, strValue) {
    LOG.debug("begin: doBaseURL | " + strTarget + " | " + strValue + " |");
    LOG.info(strValue);
    LOG.debug("end: doBaseURL | " + strTarget + " | " + strValue + " |");
}