0

我正在关联响应标头(范围=标头)中的值并在脚本中打印两次该值,但它在脚本的不同位置显示不同的值:这是日志:

Action.c(548): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415" 
Action.c(548): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(548): web_submit_data("considertakingadump_2") was successful, 3792 body bytes, 242 header bytes, 12 chunking overhead bytes    [MsgId: MMSG-26385]
Action.c(559): Registering web_reg_save_param_ex was successful          [MsgId: MMSG-26390]
Action.c(567): Notify: Parameter Substitution: parameter "corrID1" =  "3"
Action.c(568): corrID1 first: 3
Action.c(570): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(570): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(570): Redirecting "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/considertakingadump?6-1.IFormSubmitListener-considertakingadumpListe-considertakingadumpRepeater-4-considertakingadumpListItem-vilkarHoved-innerPanel-vilkarVurdering-vilkarForm" (redirection depth is 0)       [MsgId: MMSG-26694]
Action.c(570): To location "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/considertakingadump"     [MsgId: MMSG-26693]
Action.c(570): Redirecting "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/considertakingadump" (redirection depth is 1)    [MsgId: MMSG-26694]
Action.c(570): To location "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/considertakingadump?10"          [MsgId: MMSG-26693]
Action.c(570): Notify: Saving Parameter "corrID1 = 10\r\nContent-Length: 0\r\n\r\nHTTP/1.1 200 OK\r\nServer: Apache-Coyote/1.1\r\nDate: Mon, 11 Mar 2013 12:41:33 GMT\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store\r\nContent-Type: text/html;charset=UTF-8\r\nTransfer-Encoding: chunked\r\n\r\n".
Action.c(570): web_submit_data("considertakingadump_3") was successful, 10004 body bytes, 838 header bytes, 20 chunking overhead bytes   [MsgId: MMSG-26385]
Action.c(583): Notify: Transaction "Huk av for oppfyllt vilkår" ended with "Pass" status (Duration: 0,6252 Wasted Time: 0,0056).
Action.c(585): Registering web_reg_save_param_ex was successful          [MsgId: MMSG-26390]
Action.c(595): Notify: Parameter Substitution: parameter "corrID1" =  "10\r\nContent-Length: 0\r\n\r\nHTTP/1.1 200 OK\r\nServer: Apache-Coyote/1.1\r\nDate: Mon, 11 Mar 2013 12:41:33 GMT\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store\r\nContent-Type: text/html;charset=UTF-8\r\nTransfer-Encoding: chunked\r\n\r\n"
Action.c(596): corrID1 second: 10
Action.c(599): Notify: Transaction "Neste etter avhuking" started.
Action.c(601): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(601): Notify: Parameter Substitution: parameter "corrID1" =  "10\r\nContent-Length: 0\r\n\r\nHTTP/1.1 200 OK\r\nServer: Apache-Coyote/1.1\r\nDate: Mon, 11 Mar 2013 12:41:33 GMT\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store\r\nContent-Type: text/html;charset=UTF-8\r\nTransfer-Encoding: chunked\r\n\r\n"
Action.c(601): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(601): Redirecting "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/considertakingadump?10Content-Length: 0HTTP/1.1 200 OKServer: Apache-Coyote/1.1Date: Mon, 11 Mar 2013 12:41:33 GMTExpires: Thu, 01 Jan 1970 00:00:00 GMTPragma: no-cacheCache-Control: no-cache, no-storeContent-Type: text/html;charset=UTF-8Transfer-Encoding: chunked-1.ILinkListener-neste" (redirection depth is 0)         [MsgId: MMSG-26694]
Action.c(601): To location "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/considertakingadump?11&10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-neste"     [MsgId: MMSG-26693]
Action.c(601): Notify: Saving Parameter "corrID2 = 11&10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-neste\r\nContent-Length: 0\r\n\r\nHTTP/1.1 200 OK\r\nServer: Apache-Coyote/1.1\r\nDate: Mon, 11 Mar 2013 12:41:33 GMT\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store\r\nContent-Type: text/html;charset=UTF-8\r\nTransfer-Encoding: chunked\r\n\r\n".

Action.c(601): web_url("Neste") was successful, 12429 body bytes, 811 header bytes, 21 chunking overhead bytes   [MsgId: MMSG-26385]
Action.c(610): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(610): web_url("Navigasjon_topp_4_viseforslagtiltakeit.png") was successful, 32914 body bytes, 230 header bytes          [MsgId: MMSG-26386]
Action.c(618): Notify: Transaction "Neste etter avhuking" ended with "Pass" status (Duration: 0,3079 Wasted Time: 0,0053).
Action.c(620): Registering web_reg_save_param_ex was successful          [MsgId: MMSG-26390]
Action.c(628): Notify: Transaction "Send til beslutning" started.
Action.c(630): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(630): Notify: Parameter Substitution: parameter "corrID2" =  "11&10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-neste\r\nContent-Length: 0\r\n\r\nHTTP/1.1 200 OK\r\nServer: Apache-Coyote/1.1\r\nDate: Mon, 11 Mar 2013 12:41:33 GMT\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store\r\nContent-Type: text/html;charset=UTF-8\r\nTransfer-Encoding: chunked\r\n\r\n"
Action.c(630): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(630): Redirecting "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/forslagtakeit?11&10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-nesteContent-Length: 0HTTP/1.1 200 OKServer: Apache-Coyote/1.1Date: Mon, 11 Mar 2013 12:41:33 GMTExpires: Thu, 01 Jan 1970 00:00:00 GMTPragma: no-cacheCache-Control: no-cache, no-storeContent-Type: text/html;charset=UTF-8Transfer-Encoding: chunked-1.ILinkListener-neste" (redirection depth is 0)          [MsgId: MMSG-26694]

Action.c(630): To location "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/forslagtakeit?10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-nesteContent-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset"          [MsgId: MMSG-26693]

Action.c(630): Redirecting "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/forslagtakeit?10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-nesteContent-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset" (redirection depth is 1)         [MsgId: MMSG-26694]

Action.c(630): To location "http://b34aps012376.heyhay.com:8080/takeit/treatment/172415/forslagtakeit?12&10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-nesteContent-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset"       [MsgId: MMSG-26693]

Action.c(630): Notify: Saving Parameter "corrID3 = 12&10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-nesteContent-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Mon,+11+Mar+2013+12:41:33+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset\r\nContent-Length: 0\r\n\r\nHTTP/1.1 200 OK\r\nServer: Apache-Coyote/1.1\r\nDate: Mon, 11 Mar 2013 12:41:34 GMT\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store\r\nContent-Type: text/html;charset=UTF-8\r\nTransfer-Encoding: chunked\r\n\r\n".
Action.c(630): web_url("Send til beslutning") was successful, 14273 body bytes, 1800 header bytes, 21 chunking overhead bytes    [MsgId: MMSG-26385]
Action.c(639): Notify: Parameter Substitution: parameter "treatmentsId" =  "172415"
Action.c(639): web_url("Navigasjon_topp_5_fattetakeit.png") was successful, 32305 body bytes, 230 header bytes   [MsgId: MMSG-26386]
Action.c(647): Notify: Transaction "Send til beslutning" ended with "Pass" status (Duration: 0,4477 Wasted Time: 0,0047).
Action.c(649): Registering web_reg_save_param_ex was successful          [MsgId: MMSG-26390]
Action.c(659): Notify: Transaction "huk av for at valgte er godkjent" started.

这是脚本:

web_submit_data("considertakingadump_2",                     "Action=http://b34aps012376.heyhay.com:8080/takeit/treatment/{treatmentsId}/considertakingadump?6-1.IBehaviorListener.0-considertakingadumpListe-considertakingadumpRepeater-4-considertakingadumpListItem-vilkarHoved-innerPanel-vilkarVurdering-vilkarForm-vilkarsregelValg",
            "Method=POST", 
                "RecContentType=text/xml",             

"Referer=http://b34aps012376.heyhay.com:8080/takeit/treatment/{treatmentsId}/considertakingadump?5", 

                "Snapshot=t57.inf", 

            "Mode=HTTP", 
            ITEMDATA, 
            "Name=vilkarsregelValg", "Value=OPPFYLT", ENDITEM, 
            LAST);


    web_reg_save_param_ex( 
            "ParamName=corrID1",
            "LB=considertakingadump?",        
            "RB=",
            SEARCH_FILTERS,
            "Scope=Headers",
            LAST);

    buffer1 = atoi(lr_eval_string("{corrID1}"));

    lr_output_message("corrID1 first: %d", buffer1);

    web_submit_data("considertakingadump_3", 

            "Action=http://b34aps012376.heyhay.com:8080/takeit/treatment/{treatmentsId}/considertakingadump?6-1.IFormSubmitListener-considertakingadumpListe-considertakingadumpRepeater-4-considertakingadumpListItem-vilkarHoved-innerPanel-vilkarVurdering-vilkarForm",

            "Method=POST", 
            "RecContentType=text/html",             "Referer=http://b34aps012376.heyhay.com:8080/takeit/treatment/{treatmentsId}/considertakingadump?5", 
            "Snapshot=t58.inf", 
            "Mode=HTTP", 

            ITEMDATA, 
            "Name=vilkarForm48_hf_0", "Value=", ENDITEM, 
            "Name=vilkarsregelValg", "Value=OPPFYLT", ENDITEM, 
            "Name=resultat.tilleggsbegrunnelse", "Value=", ENDITEM, 
            LAST);

    lr_end_transaction("Huk av for oppfyllt vilkår",LR_AUTO); 

    web_reg_save_param_ex(
            "ParamName=corrID2",
            "LB=considertakingadump?",
            "RB=",
            SEARCH_FILTERS,
            "Scope=Headers",
            LAST);

    //skriver ut variablen corrID1 rett før den brukes i en web_url
    buffer1 = atoi(lr_eval_string("{corrID1}"));

    lr_output_message("corrID1 second: %d", buffer1);

    lr_start_transaction("Neste etter avhuking");

    web_url("Neste",                "URL=http://b34aps012376.heyhay.com:8080/takeit/treatment/{treatmentsId}/considertakingadump?{corrID1}-1.ILinkListener-neste", 

            "Resource=0", 
            "RecContentType=text/html",               "Referer=http://b34aps012376.heyhay.com:8080/takeit/treatment/{treatmentsId}/considertakingadump?7", 
            "Snapshot=t59.inf", 
            "Mode=HTTP", 
            LAST);

这不是很奇怪吗?

4

1 回答 1

1

根据您的输出日志,看起来参数 corrID1 在您在代码中提到的第一个 POST 之前已经存在值为“3”,然后您再次调用它以进行后续调用,该调用使用新值填充相同的参数。你确定你没有在脚本前面为 corrID1 调用 web_reg_save_param_ex 吗?

于 2013-03-11T20:18:41.507 回答