51Testing软件测试论坛

标题: 怎么对token进行参数化 [打印本页]

作者: endales    时间: 2008-6-20 16:36
标题: 怎么对token进行参数化
我们的系统采用token机制,每次登录系统都会分配一个token给当前用户,录好的脚本,当天可以跑,但是第二天就会报错说token过期,当然可以让开发人员把token关掉,但是这样势必比较麻烦,要是可以对token进行参数化就好了
所作尝试如下:

对expirationTime,integrityIdentifier,uniqueIdentifier 进行参数化
//correlation expirationTime in extendExpirationTime and updateCache
        web_reg_save_param("Expiration_Time1",
                "LB=<expirationTime xsi:type=\"xsd:string\">",
                "RB=</expirationTime>\n",
                LAST);


//correlation integrityIdentifier in extendExpirationTime and updateCache
        web_reg_save_param("Integrity_Id1",
                "LB=<integrityIdentifier xsi:type=\"xsd:string\">",
                "RB=</integrityIdentifier>",
                LAST);

//lr_message({Integrity_Id1});
//lr_param_sprintf("{Expiration_Time1}","log_%d.%s");


//correlation uniqueIdentifier in all webservice, except login
        web_reg_save_param("Unique_Id",
                "LB=<uniqueIdentifier xsi:type=\"xsd:string\">",
                "RB=</uniqueIdentifier>",
                LAST);
        web_add_header("Content-Type", "text/xml; charset=utf-8");

        web_add_header("SOAPAction", "\"urn:com-oocl-frm-afw-services-IAuthenticatorWS/extendExpirationTime\"");

           soap_request("StepName=extendExpirationTime",
                "URL=http://shasudv5:7777/RS_AFWServer/AFWWebService",
                "SOAPEnvelope=<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\""
                "no\"?><soap:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
                "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:types=\""
                "http://com.oocl.frm.afw.services/IAuthenticatorWS.wsdl/encodedTypes\" "
                "xmlns:tns=\"http://com.oocl.frm.afw.services/IAuthenticatorWS.wsdl\" "
                "xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:soap"
                "=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body soap"
                ":encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><q1"
                ":extendExpirationTime xmlns:q1=\"urn"
                ":com-oocl-frm-afw-services-IAuthenticatorWS\"><param0 href=\"#id1\"/><"
                "/q1:extendExpirationTime><q2:com_oocl_frm_afw_token_TokenImpl xsi:type"
                "=\"q2:com_oocl_frm_afw_token_TokenImpl\" id=\"id1\" xmlns:q2=\"http://"
                "com.oocl.frm.afw.services/IAuthenticatorWS.xsd\"><adaptorName xsi:type"
                "=\"xsd:string\">RS</adaptorName><expirationTime xsi:type=\"xsd:string"
                "\">{Expiration_Time1}</expirationTime><integrityIdentifier xsi:type="
                "\"xsd:string\">{Integrity_Id1}</"
                "integrityIdentifier><type xsi:type=\"xsd:string\">N</type>"
                "<uniqueIdentifier xsi:type=\"xsd:string\">{Unique_Id}</uniqueIdentifier><user xsi:type=\"xsd:string\""
                ">JIANGEN3</user></q2:com_oocl_frm_afw_token_TokenImpl></soap:Body></"
                "soap:Envelope>",
                "Snapshot=t5.inf",
                "ResponseParam=response",
                LAST);
但是回放的时候还是会报token expire
作者: iori    时间: 2008-6-20 16:54
这应该叫关联吧
作者: iori    时间: 2008-6-20 17:27
把运行日志贴出来




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