测试生活开始了,赶紧来这里和大家集合。

Action之间参数的传递

上一篇 / 下一篇  2008-09-08 16:33:24 / 个人分类:测试技术

一: Action的参数调用1

1、  设置参数

Action  Properters >> Action Parameter


增加input的参数和output的参数

 

2、  Action 1 的脚本:

parameter("output")="Action1 Output"

msgbox("Action1 Input:"&parameter("input"))

msgbox("Action1 Output:"&parameter("output"))

3、  Action 2 的脚本:

RunAction "Action1", oneIteration,"Action2 Input",action2
//设置"Action2 Input",存储输出参数的值为变量:action2
msgbox("Output in Action2:"&action2)

 

我们不难发现在QTP的Action之间关系

作为被调用Action1,都是使用parameter("参数名")来使用的。

作为调用Action1的Action2而言,input参数是可以往被调用Action1的操作输入的参数。Output的参数是从被调用的Action1返回的值。 

 

Browser("办公自动化系统").Page("办公自动化系统").Frame("mainFrame").WebElement("innertext:="&action2).Click

 

二、Action的参数调用2

也可以通过Global的DataTable设置参数,
比如 action1 里面 DataTable.value("colname","Global")="参数"
在action2里面 可以直接用dim colname
colname=DataTable.value("colname","Global")


TAG: 测试技术

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-28  
 123456
78910111213
14151617181920
21222324252627
282930    

我的存档

数据统计

  • 访问量: 1730
  • 日志数: 2
  • 图片数: 1
  • 建立时间: 2008-09-05
  • 更新时间: 2008-09-17

RSS订阅

Open Toolbar