51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3520|回复: 2
打印 上一主题 下一主题

[讨论] 怎么对token进行参数化

[复制链接]
  • TA的每日心情
    擦汗
    2015-8-18 16:22
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2008-6-20 16:36:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    我们的系统采用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
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情

    2016-12-30 10:59
  • 签到天数: 6 天

    连续签到: 1 天

    [LV.2]测试排长

    2#
    发表于 2008-6-20 16:54:36 | 只看该作者
    这应该叫关联吧
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    2016-12-30 10:59
  • 签到天数: 6 天

    连续签到: 1 天

    [LV.2]测试排长

    3#
    发表于 2008-6-20 17:27:10 | 只看该作者
    把运行日志贴出来
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-9-22 14:33 , Processed in 0.074388 second(s), 25 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表