初次写LR脚本,碰到许多问题,不知道哪个环节不对,望不吝赐教,很急.代码比较长,辛苦大家了作者: 含笑 时间: 2010-1-27 19:37
部分回放日志为:
Starting iteration 1.
Starting action Action.
Action.c(4): Notify: Transaction "单击网上展厅视图" started.
Action.c(8): FLEX AMF Call("AMF3_call_12") started
Action.c(8): Sending AMF request message. The following XML describes the message content:
Action.c(8):
<AMFPacket AMF_version="3">
<AMFHeaders/>
<Messages>
<Message method="null" target="/1">
<Arguments>
<Argument>
<AMF3>
<object-externalizable-custom>
<flex.messaging.messages.CommandMessage>
<destination/>
<messageId>795C59D4-24BB-45AB-47E6-6876E3B72697</messageId>
<timestamp>0</timestamp>
<timeToLive>0</timeToLive>
<headers>
<entry>
<string>DSId</string>
<string>C4F6DE11-D31C-5F2B-F4CC-B288484ACF3C</string>
</entry>
<entry>
<string>DSMessagingVersion</string>
<int>1</int>
</entry>
</headers>
<body class="flex.messaging.io.amf.ASObject" serialization="custom">
<unserializable-parents/>
<map>
<default>
<loadFactor>0.75</loadFactor>
<threshold>12</threshold>
</default>
<int>16</int>
<int>0</int>
</map>
<flex.messaging.io.amf.ASObject>
<default>
<inHashCode>false</inHashCode>
<inToString>false</inToString>
</default>
</flex.messaging.io.amf.ASObject>
</body>
<correlationId/>
<operation>5</operation>
</flex.messaging.messages.CommandMessage>
</object-externalizable-custom>
</AMF3>
</Argument>
</Arguments>
</Message>
</Messages>
</AMFPacket>
Action.c(8): "Content-Type: application/x-amf" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
Action.c(8): t=5132ms: Connecting to host 192.168.2.200:8096 [MsgId: MMSG-26000]
Action.c(8): t=5167ms: Connected socket from 192.168.2.101:2538 to 192.168.2.200:8096 in 4 ms [MsgId: MMSG-26000]
Action.c(8): t=5189ms: 418-byte request headers for "http://192.168.2.200:8096/messagebroker/amf/" (RelFrameId=1, Internal ID=1)
Action.c(8): POST /messagebroker/amf/ HTTP/1.1\r\n
Action.c(8): Content-Type: application/x-amf\r\n
Action.c(8): Cache-Control: no-cache\r\n
Action.c(8): User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; CIBA; .NET CLR 2.0.507
Action.c(8): 27; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729
Action.c(8): )\r\n
Action.c(8): Accept-Encoding: gzip, deflate\r\n
Action.c(8): Accept-Language: zh-cn\r\n
Action.c(8): Accept: */*\r\n
Action.c(8): Connection: Keep-Alive\r\n
Action.c(8): Host: 192.168.2.200:8096\r\n
Action.c(8): Content-Length: 290\r\n
Action.c(8): \r\n
Action.c(8): t=5808ms: 290-byte request body for "http://192.168.2.200:8096/messagebroker/amf/" (RelFrameId=1, Internal ID=1)
Action.c(8): \x00\x03\x00\x00\x00\x01\x00\x04null\x00\x02/1\x00\x00\x01\x0E\n
Action.c(8): \x00\x00\x00\x01\x11\n
Action.c(8): \x81\x13Mflex.messaging.messages.CommandMessage\x17destination\x0Fheaders\x1BcorrelationId
Action.c(8): \x13messageId\x13timestamp\x11clientId\x15timeToLive\x13operation\tbody\x06\x01\n
Action.c(8): #\x01\tDSId%DSMessagingVersion\x06IC4F6DE11-D31C-5F2B-F4CC-B288484ACF3C\x04\x01\x06\x01\x06
Action.c(8): I795C59D4-24BB-45AB-47E6-6876E3B72697\x05\x00\x00\x00\x00\x00\x00\x00\x00\x01\x05\x00\x00\x00
Action.c(8): \x00\x00\x00\x00\x00\x04\x05\n
Action.c(8): \x03\x01
Action.c(8): t=6038ms: 338-byte response headers for "http://192.168.2.200:8096/messagebroker/amf/" (RelFrameId=1, Internal ID=1)
Action.c(8): HTTP/1.1 200 OK\r\n
Action.c(8): Date: Wed, 27 Jan 2010 09:31:34 GMT\r\n
Action.c(8): Server: Jetty/5.1.x (Windows 2003/5.2 x86 java/1.6.0_16\r\n
Action.c(8): Expires: Sat, 25 Dec 1999 00:00:00 GMT\r\n
Action.c(8): Set-Cookie: JSESSIONID=52ss8ma1t5eeath=/\r\n
Action.c(8): Set-Cookie: JSESSIONID=prfanjh1ddwxath=/\r\n
Action.c(8): Cache-Control: no-cache\r\n
Action.c(8): Pragma: no-cache\r\n
Action.c(8): Content-Type: application/x-amf\r\n
Action.c(8): Content-Length: 583\r\n
Action.c(8): \r\n
Action.c(8): t=6316ms: 583-byte response body for "http://192.168.2.200:8096/messagebroker/amf/" (RelFrameId=1, Internal ID=1)
Action.c(8): \x00\x03\x00\x01\x00\x12AppendToGatewayUrl\x01\xFF\xFF\xFF\xFF\x02\x00\x18;jsessionid=prfa
Action.c(8): njh1ddwx\x00\x01\x00\x0B/1/onStatus\x00\x00\xFF\xFF\xFF\xFF\x11\n
Action.c(8): 丼Iflex.messaging.messages.ErrorMessage\x0Fheaders\x13rootCause\tbody\x1BcorrelationId\x17(出错一)Action.c(8): faultDetail\x17faultString\x11clientId\x15timeToLive\x17destination\x13timestamp\x19extend
Action.c(8): edData\x13faultCode\x13messageId\n
Action.c(8): \x03\x01\x01\x01\x06I795C59D4-24BB-45AB-47E6-6876E3B72697\x01\x06俥Detected duplicate HTTP
Action.c(8): -based FlexSessions, generally due to the remote host disabling session cookies. Session c
Action.c(8): ookies must be enabled to manage the client connection correctly.\x01\x05\x00\x00\x00\x00\x00
Action.c(8): \x00\x00\x00\x06\x01\x05Brf耨瓳\x00\x01\x06UServer.Processing.DuplicateSessionDetected\x06
Action.c(8): ID54AF0A6-A41E-541D-B0FA-168E8B5AE150
Action.c(8): t=6844ms: Request done "http://192.168.2.200:8096/messagebroker/amf/" [MsgId: MMSG-26000]
[ 本帖最后由 含笑 于 2010-1-27 19:42 编辑 ]作者: 含笑 时间: 2010-1-27 19:39
Action.c(8): AMF response message received. The following XML describes the message content:
Action.c(8):
<AMFPacket AMF_version="3">
<AMFHeaders>
<AMFHeader name="AppendToGatewayUrl" must_understand="true">
<string>;jsessionid=prfanjh1ddwx</string>
</AMFHeader>
</AMFHeaders>
<Messages>
<Message method="/1/onStatus" target="">
<AMF3>
<object-externalizable-custom>
<flex.messaging.messages.ErrorMessage>
<destination/>
<messageId>D54AF0A6-A41E-541D-B0FA-168E8B5AE150</messageId>
<timestamp>1264584694500</timestamp>
<timeToLive>0</timeToLive>
<correlationId>795C59D4-24BB-45AB-47E6-6876E3B72697</correlationId>
<faultCode>Server.Processing.DuplicateSessionDetected</faultCode>
<faultString>Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.</faultString>
</flex.messaging.messages.ErrorMessage>
</object-externalizable-custom>
</AMF3>
</Message>
</Messages>
</AMFPacket>
Action.c(8): Error: Server returned error for message #1 : description="AMF call returned an error, described in XML seen in extended log"
Action.c(8): There was an error during the FLEX AMF Call ("AMF3_call_12")作者: 云层 时间: 2010-1-27 19:54
flex的关联不用关联函数来做可以,flex_amf_call直接就能做关联,这样做起来就简单了,推荐你好好看看LR自带的帮助文档,里面有flex开发的关联方法作者: xubin_xubin 时间: 2010-1-28 12:47 标题: 问题解决没有 我们也遇到同样的问题。作者: 含笑 时间: 2010-1-28 14:39
正在努力解决作者: 含笑 时间: 2010-1-28 14:45
试试Flex的关联
只留下一个AMF3_call_12
Action()
{
/* lr_start_transaction("单击网上展厅视图");*/
flex_amf_call(
"AMF3_call_12",
"Gateway=http://192.168.2.200:8096/messagebroker/amf/",
"Snapshot=t29.inf",
MESSAGE,
"Method=null",
"TargetObjectId=/1",
BEGIN_ARGUMENTS,
"<AMF3><object-externalizable-custom><flex.messaging.messages.CommandMessage>\n "
"<destination/>\n <messageId>795C59D4-24BB-45AB-47E6-6876E3B72697</messageId>\n "
" <timestamp>0</timestamp>\n <timeToLive>0</timeToLive>\n <headers>\n "
"<entry>\n <string>DSId</string>\n <string>"
"C4F6DE11-D31C-5F2B-F4CC-B288484ACF3C</string>\n </entry>\n <entry>\n "
"<string>DSMessagingVersion</string>\n <int>1</int>\n </entry>\n "
"</headers>\n <body class=\"flex.messaging.io.amf.ASObject\" serialization="
"\"custom\">\n <unserializable-parents/>\n <map>\n <default>\n "
"<loadFactor>0.75</loadFactor>\n <threshold>12</threshold>\n "
"</default>\n <int>16</int>\n <int>0</int>\n </map>\n "
"<flex.messaging.io.amf.ASObject>\n <default>\n <inHashCode>"
"false</inHashCode>\n <inToString>false</inToString>\n </default>\n "
" </flex.messaging.io.amf.ASObject>\n </body>\n <correlationId/>\n "
"<operation>5</operation>\n</flex.messaging.messages.CommandMessage>"
"</object-externalizable-custom></AMF3>",
END_ARGUMENTS,
LAST);
return 0;
}
回放日志为:
Action.c(6): cxhcmeqwz\x00\x01\x00\x0B/1/onStatus\x00\x00\xFF\xFF\xFF\xFF\x11\n
Action.c(6): 丼Iflex.messaging.messages.ErrorMessage\x0Fheaders\x13rootCause\tbody\x1BcorrelationId\x17
Action.c(6): faultDetail\x17faultString\x11clientId\x15timeToLive\x17destination\x13timestamp\x19extend
Action.c(6): edData\x13faultCode\x13messageId\n
Action.c(6): \x03\x01\x01\x01\x06I795C59D4-24BB-45AB-47E6-6876E3B72697\x01\x06俥Detected duplicate HTTP
Action.c(6): -based FlexSessions, generally due to the remote host disabling session cookies. Session c
Action.c(6): ookies must be enabled to manage the client connection correctly.\x01\x05\x00\x00\x00\x00\x00
Action.c(6): \x00\x00\x00\x06\x01\x05Brg:&男\x00\x01\x06UServer.Processing.DuplicateSessionDetected\x06
Action.c(6): IE04F8A67-FD0E-09B3-395E-DD6695C94A47
Action.c(6): t=6121ms: Request done "http://192.168.2.200:8096/messagebroker/amf/" [MsgId: MMSG-26000]
Action.c(6): AMF response message received. The following XML describes the message content:
Action.c(6):
<AMFPacket AMF_version="3">
<AMFHeaders>
<AMFHeader name="AppendToGatewayUrl" must_understand="true">
<string>;jsessionid=1dpycxhcmeqwz</string>
</AMFHeader>
</AMFHeaders>
<Messages>
<Message method="/1/onStatus" target="">
<AMF3>
<object-externalizable-custom>
<flex.messaging.messages.ErrorMessage>
<destination/>
<messageId>E04F8A67-FD0E-09B3-395E-DD6695C94A47</messageId>
<timestamp>1264660409421</timestamp>
<timeToLive>0</timeToLive>
<correlationId>795C59D4-24BB-45AB-47E6-6876E3B72697</correlationId>
<faultCode>Server.Processing.DuplicateSessionDetected</faultCode>
<faultString>Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.</faultString>
</flex.messaging.messages.ErrorMessage>
</object-externalizable-custom>
</AMF3>
</Message>
</Messages>
</AMFPacket>
Action.c(6): Error: Server returned error for message #1 : description="AMF call returned an error, described in XML seen in extended log"
Action.c(6): There was an error during the FLEX AMF Call ("AMF3_call_12")
Ending action Action.作者: 含笑 时间: 2010-1-28 15:02
1.到Tree视图,将Flex AMF Call:AMF3_call_12的参数名设置为amf12
2.在snapshot中将correlationId作sava value in parameter设置,名为ParamValue_correlationId,OK在脚本中自动生成脚本为
lr_xml_get_values("XML={amf12}",
"FastQuery=/AMFPacket/Messages/Message/AMF3/object-externalizable-custom/flex.messaging.messages.ErrorMessage/correlationId",
"ValueParam=ParamValue_correlationId",
LAST);
snapshot中的Tree为:
file:///F:/amf12.JPG
3.然后将脚本中的<messageId>795C59D4-24BB-45AB-47E6-6876E3B72697</messageId>参数化为<messageId>{ParamValue_correlationId}</messageId>,保存,运行
回放日志为:
Action.c(6): 3512dhypr\x00\x01\x00\x0B/1/onStatus\x00\x00\xFF\xFF\xFF\xFF\x11\n
Action.c(6): 丼Iflex.messaging.messages.ErrorMessage\x0Fheaders\x13rootCause\tbody\x1BcorrelationId\x17
Action.c(6): faultDetail\x17faultString\x11clientId\x15timeToLive\x17destination\x13timestamp\x19extend
Action.c(6): edData\x13faultCode\x13messageId\n
Action.c(6): \x03\x01\x01\x01\x06\x01\x01\x06俥Detected duplicate HTTP-based FlexSessions, generally du
Action.c(6): e to the remote host disabling session cookies. Session cookies must be enabled to manage
Action.c(6): the client connection correctly.\x01\x05\x00\x00\x00\x00\x00\x00\x00\x00\x06\x01\x05Brg;&K
Action.c(6): \xE0\x00\x01\x06UServer.Processing.DuplicateSessionDetected\x06IE07687F3-DE1F-C707-100B-5B
Action.c(6): 662D8F3A4D
Action.c(6): t=7906ms: Request done "http://192.168.2.200:8096/messagebroker/amf/" [MsgId: MMSG-26000]
Action.c(6): AMF response message received. The following XML describes the message content:
Action.c(6):
<AMFPacket AMF_version="3">
<AMFHeaders>
<AMFHeader name="AppendToGatewayUrl" must_understand="true">
<string>;jsessionid=19vn3512dhypr</string>
</AMFHeader>
</AMFHeaders>
<Messages>
<Message method="/1/onStatus" target="">
<AMF3>
<object-externalizable-custom>
<flex.messaging.messages.ErrorMessage>
<destination/>
<messageId>E07687F3-DE1F-C707-100B-5B662D8F3A4D</messageId>
<timestamp>1264661456062</timestamp>
<timeToLive>0</timeToLive>
<correlationId/>
<faultCode>Server.Processing.DuplicateSessionDetected</faultCode>
<faultString>Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.</faultString>
</flex.messaging.messages.ErrorMessage>
</object-externalizable-custom>
</AMF3>
</Message>
</Messages>
</AMFPacket>
Action.c(6): Notify: Saving Parameter "amf12 = <?xml version="1.0" encoding="UTF-8" ?><AMFPacket AMF_version="3"><AMFHeaders><AMFHeader name="AppendToGatewayUrl" must_understand="true"><string>;jsessionid=19vn3512dhypr</string></AMFHeader></AMFHeaders><Messages><Message method="/1/onStatus" target=""><AMF3><object-externalizable-custom><flex.messaging.messages.ErrorMessage>\n <destination></destination>\n <messageId>E07687F3-DE1F-C707-100B-5B662D8F3A4D</messageId>\n <timestamp>1264661456062</timestamp>\n <timeToLive>0</timeToLive>\n <correlationId></correlationId>\n <faultCode>Server.Processing.DuplicateSessionDetected</faultCode>\n <faultString>Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.</faultString>\n</flex.messaging.messages.ErrorMessage></object-externalizable-custom></AMF3></Message></Messages></AMFPacket>"
Action.c(6): Error: Server returned error for message #1 : description="AMF call returned an error, described in XML seen in extended log"
Action.c(6): There was an error during the FLEX AMF Call ("AMF3_call_12")
Action.c(33): Notify: Parameter Substitution: parameter "amf12" = "<?xml version="1.0" encoding="UTF-8" ?><AMFPacket AMF_version="3"><AMFHeaders><AMFHeader name="AppendToGatewayUrl" must_understand="true"><string>;jsessionid=19vn3512dhypr</string></AMFHeader></AMFHeaders><Messages><Message method="/1/onStatus" target=""><AMF3><object-externalizable-custom><flex.messaging.messages.ErrorMessage>\n <destination></destination>\n <messageId>E07687F3-DE1F-C707-100B-5B662D8F3A4D</messageId>\n <timestamp>1264661456062</timestamp>\n <timeToLive>0</timeToLive>\n <correlationId></correlationId>\n <faultCode>Server.Processing.DuplicateSessionDetected</faultCode>\n <faultString>Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.</faultString>\n</flex.messaging.messages.ErrorMessage></object-externalizable-custom></AMF3></Message></Messages></AMFPacket>"
Action.c(33): Notify: Saving Parameter "ParamValue_correlationId = "
Action.c(33): "lr_xml_get_values" succeeded, 1 match processed
Ending action Action.
2.在snapshot中将correlationId作sava value in parameter设置,名为ParamValue_correlationId,OK在脚本中自动生成脚本为
lr_xml_get_values("XML={amf12}",
"FastQuery=/AMFPacket/Messages/Message/AMF3/object-externalizable-custom/flex.messaging.messages.ErrorMessage/correlationId",
"ValueParam=ParamValue_correlationId",
LAST);
snapshot中的Tree为: