提供大家学习交流的空间!
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为父子关系时,才会出现传递的参数内容。
相关阅读:
- [原创]用Schedule定时运行QTP脚本 (风过无息, 2007-3-23)
- [原创]QTP测试页面字体颜色的办法 (风过无息, 2007-3-23)
- QTP使用操作的规则 (zhou840401, 2007-3-24)
- QTP虚拟对象的使用 (zhou840401, 2007-3-24)
- QTP数据表的使用 (zhou840401, 2007-3-24)
- QTP设置可选步骤 (zhou840401, 2007-3-24)
- Descriptive programming in QTP (dcyan, 2007-3-25)
- QTP 8.2 CRACK (dcyan, 2007-3-25)
- GetROProperty,GetTOProperties,GetTOProperty的区别 (ghx, 2007-3-26)
- QTP识别和操作对象的原理 (ghx, 2007-3-26)
收藏
举报
TAG:
QTP