51Testing软件测试论坛

标题: winrunner学习的时候怎么同时录制多页 [打印本页]

作者: meizi    时间: 2005-10-25 13:19
标题: winrunner学习的时候怎么同时录制多页
我现在要用winrunner测试一个web服务器,想请教一下怎么才能够把所有的页面学习一遍
作者: pcl2004_27    时间: 2005-10-26 12:50
这个很难办到,不过有个办法,可以自己写一个应用。
扫描所有的链接,然后把每个页面的对象信息保存

下边写一个如何扫描网页中的对象伪代码例子:
                static i=0;
        static win_desc;
        static desc;
        static ret;
        static attr[];
        static windowname;
       
        #Compile the name of the window for win_get_desc
        windowname = "{class: window, label : \"!.*";
        windowname = windowname & window;
        windowname = windowname & "*\"}";
               
        #Specify the window that you want to learn
        win_get_desc(windowname, "class label", "MSW_ID","index", win_desc);
       
        #Add the window to the new GUI map file
        GUI_add("", window, "", win_desc);
        set_window(window, 1);

        #This loop goes over all the htmlxxxx in the window
        while (obj_exists ("{class:  htmlxxxx , index: "& i &"}") == E_OK)
        {
                #Get the next button description
                obj_get_desc ( "{class:  htmlxxxx , index: "& i & "}", "", "","location", desc);

                #Get the label of the button
                ret = split( desc, attr, "\\\"" );
       
                #Add the htmlxxxx description to the GUI map file
                GUI_add ("", window, attr[4], desc);
                i++;
        }

        扫描该窗体中下一个对象类型,然后加入到gui map中
               
上边是具体扫描对象的例子,还有一个就是需要在代码中添加循环吧所有的链接都保存到一个数组中,然后用队列或者栈的算法,处理掉每一个链接,然后在把每个对象放gui map中
作者: vivian84    时间: 2005-11-2 09:30
好东西哦,顶一下!~
作者: sbandbt    时间: 2005-11-4 16:11
嗯,是不错,就是看不懂~~~~~~~~~
作者: xiaoqingting    时间: 2005-11-8 11:53
看不懂说明我们还需要努力,加油阿!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2