首页 > 代码库 > LoadRunner 函数之lr_xml_get_values
LoadRunner 函数之lr_xml_get_values
简单实例如
char *xml_input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">" "<S:Body>" "<ns2:handleResponse xmlns:ns2=\"http://eaop.gd.chinamobile.com/\">" "<return>" "<queryecouponsbymobilenumresp>" "<msgheader>" "<req_seq>20161206165439111</req_seq>" "<ope_seq>20161220161336177143</ope_seq>" "<retinfo>" "<rettype>0</rettype>" "<retcode>0</retcode>" "<retmsg>success</retmsg>" "</retinfo>" "</msgheader>" "<msgbody>" "</msgbody>" "</queryecouponsbymobilenumresp>" "</return>" "</ns2:handleResponse>" "</S:Body>" "</S:Envelope>"; Action(){ lr_save_string(xml_input, "XML_Input_Param"); // Save input as parameter // lr_xml_get_values:Retrieves values of XML elements found by a query. lr_xml_get_values("XML={XML_Input_Param}", "ValueParam=OutputParam", "Query=/Envelope/Body/handleResponse/return/queryecouponsbymobilenumresp/msgheader/retinfo/retcode", LAST ); lr_output_message(lr_eval_string("Query result = {OutputParam}")); return 0; }
输入结果如
LoadRunner 函数之lr_xml_get_values
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。