zoukankan      html  css  js  c++  java
  • 开始学习qtp第一天对象库添加和检查点的添加

    作者: TIB自动化测试工作室  核心成员 郭振华

    原文:http://www.automationqa.com/uchome/space.php?uid=290&do=blog&id=393

    从2011年的12月15日起开始从新学习QTP自动化,这是昨天学习的知识点:

    1.对象识别技术
    2.对象的添加和属性的获取
    3.动态消息的获取
    4.输出值
     
    一下是学习的代码:
     
    '******************************************************************************************************
    '飞机订票系统检查点和参数化学习
    '******************************************************************************************************
    '******************************************************************************************************
    '登录账号和密码的参数化
    '******************************************************************************************************
    Dialog("Login").WinEdit("Agent Name:").Set DataTable("UserName", dtGlobalSheet)
    Dialog("Login").WinEdit("Password:").SetSecure DataTable("Passwd", dtGlobalSheet)
    Dialog("Login").WinButton("OK").Click
     
    If  Dialog("Login").Exist(2) Then
     
    Dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please").Check CheckPoint("Incorrect password. Please")'检查点
     
    Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
     
    Dialog("Login").Close
     
     else
     
        If  Window("Flight Reservation").Exist(2)  Then
     
     
    '******************************************************************************************************
    '开始订票
    '******************************************************************************************************
    Window("Flight Reservation").ActiveX("MaskEdBox").Type "121212"
        Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
    Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
    Window("Flight Reservation").WinEdit("Name:").Set "andy"
    Window("Flight Reservation").WinButton("FLIGHT").Click
    Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
    Window("Flight Reservation").WinEdit("Name:").Set "andy"
    Window("Flight Reservation").WinRadioButton("First").Set
    Window("Flight Reservation").WinButton("Insert Order").Click
     
    '******************************************************************************************************
    '设置检查点
    '******************************************************************************************************
     
       Window("Flight Reservation").WinButton("Update Order").Check CheckPoint("Update Order")
    Window("Flight Reservation").WinButton("Delete Order").Check CheckPoint("Delete Order")
                Window("Flight Reservation").ActiveX("Threed Panel Control").Check CheckPoint("Threed Panel Control")
    Window("Flight Reservation").WinEdit("Order No:").Output CheckPoint("Order No:_2")'将订单号输出到文本中
    Window("Flight Reservation").WinEdit("Order No:").Check CheckPoint("Order No:")
     
    '******************************************************************************************************
    '设置检查点
    '******************************************************************************************************
           Dim Get_Inserter_Done
             Get_Inserter_Done=Window("Flight Reservation").ActiveX("Threed Panel Control").GetROProperty("text")
        print Get_Inserter_Done
     
    End If
     
    End If
     
  • 相关阅读:
    【转】awk用法介绍
    【转】Shell执行MySql操作
    curl访问nagios中Host Status Details For All Host Groups页面的方法
    【转】命令行浏览器 curl 命令详解,Linux中访问url地址
    【转】DELL R710服务器可以安装的VMWare ESX Server 4.1 全套下载带注册码
    【转】一些常用的Vi命令,可帮助脱离鼠标
    乐观处世,诚实做人,不骄不躁,积极进取; 勇于创新,踏实实现,谨慎规划,付诸实践; 事在人为
    【转】Linux方向职业分析
    【转】[Asp.net]常见数据导入Excel,Excel数据导入数据库解决方案,总有一款适合你!
    【转】Nagios安装部署与Cacti整合文档超精细版本
  • 原文地址:https://www.cnblogs.com/testware/p/2290626.html
Copyright © 2011-2022 走看看