51Testing软件测试论坛

标题: HELP!!!! [打印本页]

作者: qh_tsuan    时间: 2008-4-9 15:45
标题: HELP!!!!
求救:
我的程序框架如下,编的是一个通用的测试框架:
        unload();
        GUI_unload_all();
        #get the test dir
        static test_director = getvar("searchpath");
        test_director = substr(test_director,match(test_director,"<") +1,match(test_director,">") - 2);
       
        static path_lib = "\\path.lib";
        static utils_lib = "\\utils.lib";
        load(test_director & path_lib);
        load(test_director & utils_lib);
        #global variable is defined in the path.lib
        const RADIO_CONFIG_GUI = "\\waris_conv_win_radioconfiguration\\radioconfiguration.gui";
        #const TABLE = "waris_conv_win_radioconfiguration_10.xls";#data base
        static cps_port = "";
        #select the tab WIN_TREE => LIST_TREE => SEL_PATH
        #                                    => WIN_TAB => TAB
        const LIST_TREE = "SysTree";
        const WIN_TREE = "TreeView";
        const SEL_PATH= "Device at COM4 Port;Radio Configuration";#the path to select the window which will be tested.
        const WINDOW = "RadioConfiguration";#The window include the tab
        const WIN_TAB = "RadioConfigurationTab";#The fram of the tab
        const TAB = "DefaultDisplay";#the table of the window
       
        #initial the environment
        initial_environment();
        if(GUI_load(test_director & RADIO_CONFIG_GUI) != E_OK)
        {
                tl_step("load gui",1,RADIO_CONFIG_GUI & " failed");
        }

        rc = check_box_test( WIN_TREE, LIST_TREE,SEL_PATH, WINDOW,
                                                                    WIN_TAB,TAB,TABLE, cps_port );
        if(rc != E_OK )
        {
                tl_step("Test status",1,"Failed");
        } else {
                tl_step("Test status",0,"Successful");
        }

        #close the table
        ddt_close(TABLE);
        clear_environment();
        unload();
        GUI_unload_all();
        GUI_close_all();
然后用
call_close "d:\\test"("data1.xls");
call_close "d:\\test"("data2.xls");
第一个call_close 语句可以顺利执行但是当执行的第二个call语句时在
        if(GUI_load(test_director & RADIO_CONFIG_GUI) != E_OK)
        {
                tl_step("load gui",1,RADIO_CONFIG_GUI & " failed");
        }
这个地方load gui文件出错
请高手指点。
作者: qh_tsuan    时间: 2008-4-9 16:39
补充一下错误码是:-1007
说文件可能已经打开,但我查看了一下没有打开
作者: melanqy    时间: 2008-4-10 20:36
就执行loadGUI的时候有问题吗?
我把你的程序简化成
unload();
GUI_unload_all();      
if(GUI_load(test_director & RADIO_CONFIG_GUI) != E_OK)
{
       tl_step("load gui",1,RADIO_CONFIG_GUI & " failed");
}
unload();
GUI_unload_all();
GUI_close_all();
用call_close "d:\\test"();调用没出现问题,(call_close加上"data1.xls"这个参数我不明白,就给去了。)




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