提供大家学习交流的空间!

Action之间参数传递

上一篇 / 下一篇  2007-03-27 15:02:45 / 个人分类:QTP

Action之间的参数传递
例如:在Action1中,有如下代码:
out_str="This is out_string"
RunAction "Action2",oneIteration,out_str
在Acton2中,在其step->Action Properties中的,input参数栏,加入out_str后,
msgbox(parameter("out_str")),就能正确显示参数了 

按照该方法如下:

1.加入Action1后,输入:out_str="This is out_string"
RunAction "Action2",oneIteration,out_str

2.然后再加入Action2,注意:Action1和Action2是并列关系,

在其step->Action Properties中的,input参数栏,加入out_str后,

这是在Action2中输入:msgbox(parameter("out_str"))

当运行的时候会出现两个msgbox,其中第一个显示内容为:"This is out_string" ;第二个msgbox显示内容为:空;

当把和Action1并列的那个Action2去掉后就可以出现一个msgbox,其中显示内容为:"This is out_string",

结论: Action1和Action2为父子关系时,才会出现传递的参数内容。


TAG: QTP

要走就走100年 引用 删除 cswalkman   /   2009-04-29 13:52:05
步骤混乱
引用 删除 yay   /   2007-03-27 16:51:22
同级Aciton间也是可以传递参数的。。
 

评分:0

我来说两句

日历

« 2024-04-28  
 123456
78910111213
14151617181920
21222324252627
282930    

我的存档

数据统计

  • 访问量: 8056
  • 日志数: 10
  • 书签数: 1
  • 建立时间: 2007-03-21
  • 更新时间: 2007-03-29

RSS订阅

Open Toolbar