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

发布新日志

  • 进入了新的项目

    2008-09-17 15:09:41

    今天进入了新的项目,不用再深刻地研究QTP了。挺无聊的。

  • 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")

我的栏目

我的存档

数据统计

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

RSS订阅

Open Toolbar