51Testing软件测试论坛

标题: 编写脚本时遇到的问题 [打印本页]

作者: maxime    时间: 2006-5-17 15:33
标题: 编写脚本时遇到的问题
参数化一个变量后,进行多个循环,我定义了一个外部变量,想将每次循环得到的值赋给定义好的外部变量,不知道该怎么做?
以下时部分代码:
  web_custom_request("OSOBJP.HDR_2",
                "URL=http://*****",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://*****",
                "Snapshot=t60.inf",
                "Mode=HTML",
                "Body=pageaction=SAVE&gisinstalled=false&profileorganization=&categorymanufacturer=&can_delete=true&audittablename=R5OBJECTS&sysleveldesc=&classorganization=&autonumber=false&can_insert=true&locorganization=&can_update=true&categoryclass=&persontypefilter=&usrgroup=TEST&addgisasset=&recordid=&statusrcode=I&pagemode=display&new_permissions=true&assleveldesc=&eqrtype=P&categoryclsorg=&compleveldesc=&linkgiswo=0&multiorg=&transferequipment=&costrollupparentasset=&createwo=&criticality=&"
                "criticality_display=&creategisasset=&equipmentdesc={lib_position}&syslevel=&eqtype=P&eqtype_display=Position&linearreferenceprecision=&linearreferenceprecision_display=&complevel=&gisobjid=&viewgisattributes=&cgmp=&geographicalreference=&viewgismap=&vmrsdesc=&profile=&department=*&ylocation=&dependentonparentasset=&outofservice=0&assetstatus=I&assetstatus_display=Install%C3%A9&location=&xlocation=&linearreferenceuom=&linearreferenceuom_display=&production=-1&organization=*&equipmentlength=&safety"
                "=&costcode=&class=&category=&preventwocompletion=&soldscrapdate=&equipmentno={Cod_Position}&assignedto=&commissiondate=05%2F16%2F2006&gislayer=&linearequipmentsearch=&withdrawaldate=&asslevel=&equipmentlengthuom=&equipmentlengthuom_display=&transferdate=&meterunit=&parentasset=&PAGEMODE=display&SYSTEM_FUNCTION_NAME=OSOBJP&CURRENT_TAB_NAME=HDR&USER_FUNCTION_NAME=OSOBJP&CHECK_CF_CHANGEFLAG=true&CHANGEDCUSTOMFIELDS=",
                LAST);
以上红色部分为参数化变量
赋值给事先定义好的外部变量:      cod_precedent=&equipmentno;
                                                       lib_precedent=&equipmentdesc;

结果出错:   Action.c (120): undeclared identifier `equipmentno'
                          Action.c (121): undeclared identifier `equipmentdesc'
作者: maxime    时间: 2006-5-17 18:46
problem solved !!

cod_precedent=lr_eval_string("{Cod_Position}");




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