Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
Variables 从Selenium Server获取变量的变通方法,无需使用;“回声”;或者一种附加语言_Variables_Selenium_Echo - Fatal编程技术网

Variables 从Selenium Server获取变量的变通方法,无需使用;“回声”;或者一种附加语言

Variables 从Selenium Server获取变量的变通方法,无需使用;“回声”;或者一种附加语言,variables,selenium,echo,Variables,Selenium,Echo,我们公司销售的测试套件能够运行selenium测试以及其他几种协议 要使用它,最终用户将安装我们的应用程序和selenium服务器文件 当用户根据在IDE中使用的命令编写测试用例时,除了echo命令外,所有命令都在Selenium服务器上工作。这显然是Selenium服务器的一个已知限制,除了echo之外,每个IDE命令都可以工作 这显然是有意的配置: 我们似乎无法找到一种方法,让我们的应用程序在存储变量后将其从Selenium服务器中取出。。。因为在IDE上工作的echo命令从Selenium

我们公司销售的测试套件能够运行selenium测试以及其他几种协议

要使用它,最终用户将安装我们的应用程序和selenium服务器文件

当用户根据在IDE中使用的命令编写测试用例时,除了echo命令外,所有命令都在Selenium服务器上工作。这显然是Selenium服务器的一个已知限制,除了echo之外,每个IDE命令都可以工作

这显然是有意的配置:

我们似乎无法找到一种方法,让我们的应用程序在存储变量后将其从Selenium服务器中取出。。。因为在IDE上工作的echo命令从Selenium服务器返回一个错误

有几种语言的Selenium服务器绑定,但不适用于我们的应用程序。由于我们的应用程序和Selenium服务器是在Windows环境中分发给最终用户的,因此默认情况下系统上没有安装第三方语言,如Java、c-sharp、python等


有没有一种方法可以在不将整个编程语言安装到每个最终用户的PC上的情况下从Selenium服务器中获取变量?

我对Selenium一无所知,但是.Net在返回到XP的每个windows版本上都安装得很好(对于XP,您必须自己安装),请参见


因此,您应该可以使用C#(或任何.Net语言)之类的工具来编写解决方案。无论如何,这可能意味着安装一个定制的软件来代替您
Echo
。(但正如我所说,我对硒一无所知)

不确定这是否有帮助。 我编写了一个用户扩展命令,以便能够在日志文件中获取变量值。新命令采用与echo命令相同的参数,另外还有一个参数告诉您需要在哪个日志级别提供输出。对于数据驱动测试,我使用“警告”级别过滤掉命令中用于数据读取和循环的所有信息日志消息

    Selenium.prototype.doEchoLog = function(strMessage, Level) {   
/**
  * Prints the specified message into the Log (log file) using the level as indicated in the second argument 
  *
  * @param strMessage the message to print
  * @param Level denote the logging level to be used for this message (debug | info | warn | error)
  */

// translate the Level value to a usable one letter value        
    Level = Level.substring(0,1);
    // output the given message to the Log at the indicated level
    if (Level == "d" ) { LOG.debug(strMessage);
    } else if (Level == "i" ) { LOG.info(strMessage);
    } else if (Level == "w" ) { LOG.warn(strMessage);
    } else if (Level == "e" ) { LOG.error(strMessage);
    } else LOG.error("use: echoLog <text> <debug|info|warning|error>");
}
Selenium.prototype.doEchoLog=函数(strMessage,Level){
/**
*使用第二个参数中指示的级别将指定的消息打印到日志(日志文件)中
*
*@param strMessage要打印的消息
*@param Level表示用于此消息的日志记录级别(debug | info | warn | error)
*/
//将级别值转换为可用的一个字母值
级别=级别。子字符串(0,1);
//以指定的级别将给定消息输出到日志
if(Level==“d”){LOG.debug(strMessage);
}else if(Level==“i”){LOG.info(strMessage);
}else if(Level==“w”){LOG.warn(strMessage);
}else if(Level==“e”){LOG.error(strMessage);
}else LOG.error(“使用:echoLog”);
}

Selenium服务器依赖于Java,不是吗?或者您计划如何在没有它的情况下执行selenium服务器?