• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

WinRunner学习

发布: 2008-6-26 12:57 | 作者: 网络转载 | 来源: IT实验室 | 查看: 226次 | 进入软件测试论坛讨论

领测软件测试网    1,report_msg  :  prints a user-defined string  expression to the test run report

        2,   pause  :     The pause function stops the test run and displays a string expression in a message box on the screen
          report_Msg和pause是在Win下显示的信息,在UNIX下是printf

        3,   radio_button :  控制按扭属性是ON还是OFF,如:
        set_window ("Flight Reservation", 3);
        button_set ("{class: radio_button, MSW_class: Button, label: Business}", ON);

        4,    return[expression]  : 返回值

        5,脚本格式 :
         Test Header :
         ---------> Test Name
         ---------> Subject
         ---------> Test Creator
         ---------> Date of creation/Date of revision
         ---------> Purpose of the test
         正式脚本

        6,static const <CONST_NAME> = <const_value>;放在脚本最前面

        7,[static/public] <variable_name> = [<variable_value>];静态和公共变量

        8, 三种判断方式
         ------->if (win_exists ("Window_Name") == 0) {
          set_window ("Window_Name");
         --------> if (!win_exists ("Window_Name")) {
           set_window ("Window_Name");
         ---------> if (win_exists ("Window_Name") == E_OK) {
            set_window ("Window_Name");

        9,自己创建错误提示代码的协定
         -------->Error codes should be in capital letters.必须为大写字母
         -------->Error codes should begin with the letter “E” followed by an underscore   (for example, E_MY_ERROR).
          -------->Error code numbers should include a dash “-” followed by a five digit   value (for example, -31001).
         -------->Error codes should be defined as public in a library or initialization test   or example, public const E_MY_ERROR = -31001).

        10, GUI_Load和GUI_Unload
         GUI_Load(file_name):   加载GUI的MAP文件,加载的是全路径
         GUI_unload( ): 释放GUI文件
         如:
        # This loads the GUI file

        GUI_load ("E:\\file1.gui");
        GUI_list_map_buffers(out_file, out_buffer);

        # The out_file contain the loaded gui file file1.gui.

        GUI_unload (file1.gui);

        # This unloads the GUI file

        GUI_list_map_buffers(out_file, out_buffer);
        # Now the out_file array does not contain file1.

        11,tl_step  :  可以输出一些测试的信息

        12,   Function Header
        The function header is placed above a user defined function. Like the Test
        Header, the function header is enclosed by the "#" symbol and stores
        information about the function:
        >Function Name
        >Descrīption or purpose of the function
        >Input parameters
        >Output parameters
        >Return Values

        For example:
        ################################################################
        # FUNCTION: get_flight_from_table
        # PURPOSE: This function is static only to this file. It selects a flight from the
        # flight table using a given flight number. Also uses split() function to access the
        # flight number from the table.
        #
        # INPUT PARAMS: flight_num   The flight number to be selected.
        # OUTPUT PARAMS:   none
        # RETURN VALUES: Standard return values.
        ###############################################################
        static function get_flight_from_table (in flight_num){...

        13, TSL includes four types of functions:
        >Context Sensitive functions perform specific tasks on GUI objects, such as
        clicking a button or selecting an item from a list. Function names, such as
        button_press and list_select_item, reflect the function’s purpose.
        >Analog functions depict mouse clicks, keyboard input, and the exact
        coordinates traveled by the mouse.
        >tandard functions perform general purpose programming tasks, such as
        sending messages to a report or performing calculations.
        >Customization functions allow you to adapt WinRunner to your testing
        environment.

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/

TAG: winrunner WinRunner 学习


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网