|
使用http协议来对flex的网站进行测试;由于服务器端和客户端都是基于xml进行文件的交互,所以想用loadrunner自带的lr_xml_get_values函数保存一些服务器端的结果,用于数据的关联。可是lr_xml_get_values出现错误,如下的红色字体
不知道问题出现在哪里,请大家帮忙,谢谢!
代码片段:
// 注册函数,用于将服务器回包的body部分保存下来
web_reg_save_param("xmlcontent", "LB=", "RB=", "Search=BODY", LAST);
//向服务器提交post,(使用的是xml格式)
web_custom_request("counter**_2",
"URL=http://loanoriginationqa:8080/lo-web/service/counter**/?_method=PUT&uniqueId=Tue%20Aug%2010%2014:05:42%20GMT+0800%202010",
"Method=POST",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://loanoriginationqa:8080/lo-web/flex/main.swf",
"Snapshot=t14.inf",
"Mode=HTTP",
"EncType=text/xml",
"Body=<counter**>\n <entityGroup>\n <groupId>181</groupId>\n <groupName>LO_QA</groupName>\n </entityGroup>\n <countryOfIncorporation>\n <code>AF</code>\n <name>Afghanistan</name>\n </countryOfIncorporation>\n <description>Created By Yang</description>\n <mailingCity>TestCity</mailingCity>\n <mailingZipCode>110006</mailingZipCode>\n <industry>\n <code>25401010</code>\n <description>Advertising</description>\n </industry>\n <type>\n <code>ASS</code>\n <description"
">Insurance</description>\n </type>\n <status>New</status>\n <mailingState>TestCity</mailingState>\n <cifNumber>1111</cifNumber>\n <businessRegistrationNo>000002</businessRegistrationNo>\n <withBankSince>08-01-2012</withBankSince>\n <relationship/>\n <mailingCountry>\n <code>CN</code>\n <name>China</name>\n </mailingCountry>\n <shortName>company_2</shortName>\n <longName>company</longName>\n <contacts/>\n <mailingAddress1>No details</mailingAddress1>\n</counter**>",
LAST);
lr_output_message(lr_eval_string("{xmlcontent}"));//通过打印的数据可以看出,xmlcontent正确的保存了服务器端返回的数据
lr_xml_get_values("XML={xmlcontent}", "ValueParam=Counter**ID", "Query=/counter**/code");//这步会出现错误提示:Error: C interpreter run time error: Action.c (334): Error -- memory violation : Exception ACCESS_VIOLATION received
lr_output_message(lr_eval_string("Query result = {Counter**ID}"));//由于上步的错误,没运行到此步骤就推出了
服务器端和客户端交互的数据格式:
客户端提交:
<counter**>
<mailingState>TestCity</mailingState>
<cifNumber>1111</cifNumber>
<businessRegistrationNo>000003</businessRegistrationNo>
<relationship/>
<type>
<code>ASS</code>
<description>Insurance</description>
</type>
<mailingCountry>
<code>AF</code>
<name>Afghanistan</name>
</mailingCountry>
<status>New</status>
<contacts/>
<mailingAddress1>No details</mailingAddress1>
<mailingZipCode>110006</mailingZipCode>
<entityGroup>
<groupId>181</groupId>
<groupName>LO_QA</groupName>
</entityGroup>
<shortName>company_3</shortName>
<longName>company</longName>
<countryOfIncorporation>
<code>AF</code>
<name>Afghanistan</name>
</countryOfIncorporation>
<mailingCity>TestCity</mailingCity>
<industry>
<code>25401010</code>
<description>Advertising</description>
</industry>
<description>Created By Yang</description>
</counter**>
服务器端返回:
<counter**>
<code>764</code>
<shortName>company_3</shortName>
<longName>company</longName>
<description>Created By Yang</description>
<type>
<code>ASS</code>
<description>Insurance</description>
</type>
<cifNumber>1111</cifNumber>
<businessRegistrationNo>000003</businessRegistrationNo>
<countryOfIncorporation>
<code>AF</code>
<name>Afghanistan</name>
</countryOfIncorporation>
<industry>
<code>25401010</code>
<description>Advertising</description>
</industry>
<status>New</status>
<mailingAddress1>No details</mailingAddress1>
<mailingCity>TestCity</mailingCity>
<mailingZipCode>110006</mailingZipCode>
<mailingState>TestCity</mailingState>
<mailingCountry>
<code>AF</code>
<name>Afghanistan</name>
</mailingCountry>
<contacts/>
<relationship/>
<entityGroup>
<groupId>181</groupId>
<groupName>LO_QA</groupName>
</entityGroup>
</counter**> |
|