简体   繁体   English

WScript回显在UFT中不起作用

[英]WScript echo is not working in UFT

I am trying to use WScript in QTP action. 我正在尝试在QTP操作中使用WScript。 But I am getting error as WScript object required. 但是我收到错误,因为需要WScript对象。

Example : WScript.echo("ICHO") is not working in UFT. 示例:WScript.echo(“ ICHO”)在UFT中不起作用。 The same is working if I run using .js or .vbs file. 如果我使用.js或.vbs文件运行,则同样有效。

In vbscript files (or js files) executed under the native windows scripting engine there is an WScript object, but this object is not part of the language, it is exposed by the host executable ( cscript.exe or wscript.exe ) that has instantiated the language engine. 在本机Windows脚本引擎下执行的vbscript文件(或js文件)中,有一个WScript对象,但是该对象不是语言的一部分,已被实例化的主机可执行文件( cscript.exewscript.exe )公开。语言引擎。

As you are not using any of those hosts, you don't have the WScript object available. 由于您没有使用任何这些主机,因此您没有WScript对象可用。

Try with 试试看

Print("ICHO")

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

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