QTP的那些事--可重用action(call to existing action)的使用
2012-03-25 15:53
387 查看
参考了下QTP的帮助文档中的飞机订票系统的使用方式。
在被重用的action中设置action properties中的parameters属性,设置输出或者是返回的值。
parameter(“属性值”),即可,返回值也需要采用这种方式即可。
callAction “action名称[action所在的test的名称]”,action中输入参数1,action中输入参数2,…,action中输出参数,例如如下:
第一个参数ActionName参数:
String
The name of the action.
Note: 在语句中必须要强制赋值给actionname不能使用变量进行设置. Do not use a variable. For example, write:
RunAction="Action1[ExternalTest]"
and not:
aName="Action1[ExternalTest]"
RunAction aName
第三个参数Parameters参数:
Variant
Optional.
The values and storage locations for the called action's input and output parameters. Input parameters are listed before output parameters.
For an input parameter, specify either a fixed value or the name of another defined parameter (可以是Data Table 参数, environment 参数, or 一个action中call action properties中的input parameter参数) from which the argument should take its value.
For an output parameter, specify either a variable in which you want to store the value or the name of a defined parameter (Data Table parameter, environment parameter, or an action output parameter of the calling action).
大致就是输入参数需要输入一个特定的值,而对于输出参数只需要指定一个变量赋值即可。在被调用的action中的输入参数或者是输出参数可以使datatable对象,可以使environment对象,可以使action属性中的输出参数属性。
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
在被重用的action中设置action properties中的parameters属性,设置输出或者是返回的值。
parameter(“属性值”),即可,返回值也需要采用这种方式即可。
callAction “action名称[action所在的test的名称]”,action中输入参数1,action中输入参数2,…,action中输出参数,例如如下:
RunAction "销售日报表查询 [销售日报表]", oneIteration,"BJ-kk123-SH ","ON","ON","","",res QTP的帮助文档对对于RunAction,说明是有三个参数,第一个参数是需要运行的action的路径,第二个是运行的迭代的次数(对于被运行的action如果参数是datatable的时候可能会用上),第三个参数就是被运行的action运行的输入参数值,parameter的介绍如下:
第一个参数ActionName参数:
String
The name of the action.
Note: 在语句中必须要强制赋值给actionname不能使用变量进行设置. Do not use a variable. For example, write:
RunAction="Action1[ExternalTest]"
and not:
aName="Action1[ExternalTest]"
RunAction aName
第三个参数Parameters参数:
Variant
Optional.
The values and storage locations for the called action's input and output parameters. Input parameters are listed before output parameters.
For an input parameter, specify either a fixed value or the name of another defined parameter (可以是Data Table 参数, environment 参数, or 一个action中call action properties中的input parameter参数) from which the argument should take its value.
For an output parameter, specify either a variable in which you want to store the value or the name of a defined parameter (Data Table parameter, environment parameter, or an action output parameter of the calling action).
大致就是输入参数需要输入一个特定的值,而对于输出参数只需要指定一个变量赋值即可。在被调用的action中的输入参数或者是输出参数可以使datatable对象,可以使environment对象,可以使action属性中的输出参数属性。
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
相关文章推荐
- QTP的那些事--有关qtp中的action模板的使用
- android ActionBar-PullToRefresh 下拉刷新的使用方法
- 转载:QTP的Test参数以及顶级Action参数的使用
- xcode6 使用MJRefresh,Too many arguments to function call, expected 0, have *
- Action!Call拨打电话(Intent.ACTION.CALL的使用)
- 关于ajax载入窗口使用RedirectToAction在窗口显示的问题
- PHP 使用 Mongodb driver:Call to undefined method MongoDB\Driver\WriteConcern::isDefault()
- 行为召唤(call to action)之后是什么?
- StringBuffer使用append提示String concatenation as argument to 'StringBuffer.append()' call
- php7使用mysql扩展程序,Uncaught Error: Call to undefined function mysql_connect() in xxx
- QTP的那些事--xpath的使用(转)
- php使用curl函数提示Call to undefined function curl_init()
- Python3.x中,使用print时出错(SyntaxError: Missing parentheses in call to 'print')解决办法
- QTP的那些事--页面的加载的使用方式
- 使用FABridge时,出现You are trying to call recursively into the Flash Player which is not allowed…错误的处理
- QTP的那些事--systemutil对象使用
- QTP中action使用,包括多action复用(转)
- 使用 Action Script Viewer(ASV) 还原 swf to fla 的方法
- 如何提高客户的转化率-Call to Action的优化
- QTP的那些事---描述性编程的使用