51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1049|回复: 2
打印 上一主题 下一主题

[原创] 关于不同脚本之间的action调用

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-11-11 12:04:31 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 clei_hs 于 2010-11-11 13:37 编辑

能否用变量名做runAction的action名称?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2010-11-12 11:11:19 | 只看该作者
结贴:可以在使用之前,先call to copy of action,然后再使用参数调用即可。
回复 支持 反对

使用道具 举报

该用户从未签到

2#
发表于 2010-11-11 17:58:40 | 只看该作者
RunAction Statement
Description
Runs the specified action in the test.

Note: The RunAction statement can run only actions that are already associated with your test as part of the test flow. Therefore, in order to enter a RunAction statement in the Expert View for an external action, you must first insert a call to the action (Insert > Call to Action) or copy the external action (Insert > Copy of Action) into your test. Using this option associates the action with the test and also inserts a RunAction statement for you. After the the external action is added to the test flow, you can add additional calls to that external action in the Expert View.

If you insert a RunAction statement in the Expert View for an external action that is not already associated with your test as a part of the test flow, the RunAction statement fails. For more information on copying or calling external actions, see the HP QuickTest Professional User Guide.

Syntax
RunAction ActionName, [Iteration , Parameters]


Argument
Type
Description

ActionName  String  The name of the action.  
Iteration  Variant  Optional.
-- oneIteration or 0 (Default)—Runs the action only once, using the row in the action's data sheet that corresponds to the global data sheet iteration counter.
If the action's data sheet contains fewer rows than the global sheet, the last row of the action's data sheet will be used for each subsequent iteration.
-- allIterations or 1—Runs iterations on all rows.
-- iteration row range (for example, "1-7")—Indicates the rows for which action iterations will be performed
Note: Iteration is required when calling an external action, but optional when calling a local action (from within the test).  
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 parameter, environment parameter, or an action input parameter of the calling action) 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).  


Return Value
Variant.

If the action called by the RunAction statement includes an ExitAction statement, the RunAction statement can return the value of the ExitAction's RetVal argument. For more information, see ExitAction Statement.

Examples
The following example calls the SearchFlight action, and runs all iterations of the action.

RunAction "SearchFlight", allIterations

The following example performs the same call as the previous example, but runs only one iteration of the action and saves the returned value to the AxnVal variable.

AxnVal=RunAction ("SearchFlight", oneIteration)

The following example runs one iteration of the action, supplies a string value of MyValue for the input parameter, and stores the resulting value of the output parameter in a variable called MyVariable.

RunAction "Action2", oneIteration, "MyValue", MyVariable
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-8 07:47 , Processed in 0.068621 second(s), 29 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表