51Testing软件测试论坛

标题: 紧急求助:web_custom_request中BodyBinary中的内容如何参数化呢? [打印本页]

作者: luozhi4102    时间: 2018-4-12 16:41
标题: 紧急求助:web_custom_request中BodyBinary中的内容如何参数化呢?
        web_custom_request("landExpansionCorpPlans_2",
                "URL=http://172.56.2.170:8888/ApiServer/api/eim/landExpansionCorpPlans",
                "Method=POST",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=application/json",
                "Referer=http://172.56.2.170:8888/eim/landExpansionPlanProject.html",
                "Snapshot=t86.inf",
                "Mode=HTML",
                "EncType=application/json;charset=utf-8",
                "BodyBinary={\"PlanName\":\"planName1\",\"CorpId\":\"TotalCompany\",\"CycleType\":\"1\",\"Year\":2016,\"Quarter\":0,\"Remark\":\"\",\"IsSaveDraf\":true,\"CurrentCorpTarget\":{\"Targets\":[{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"LongProjectAmount\",\"TargetType\":\"1\",\"FieldValue\":\"2000\",\"FieldName\":\"\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE4\\xB8\\xAA\\xE6\\x95\\xB0\",\"DataType\":2,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE4\\xB8\\xAA\",\"FieldIndex\":10},{\""
                "CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"TotalLandArea\",\"TargetType\":\"1\",\"FieldValue\":\"581233333\",\"FieldName\":\"\\xE6\\x80\\xBB\\xE7\\x94\\xA8\\xE5\\x9C\\xB0\\xE9\\x9D\\xA2\\xE7\\xA7\\xAF\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE3\\x8E\\xA1\",\"FieldIndex\":20},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"SaleAmount\",\"TargetType\":\"1\",\"FieldValue\":\"\",\"FieldName\":\""
                "\\xE6\\x80\\xBB\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":30},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"CapacityArea\",\"TargetType\":\"1\",\"FieldValue\":\"\",\"FieldName\":\"\\xE6\\x80\\xBB\\xE5\\xBB\\xBA\\xE7\\xAD\\x91\\xE8\\xAE\\xA1\\xE5\\xAE\\xB9\\xE9\\x9D\\xA2\\xE7\\xA7\\xAF\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE3\\x8E\\xA1\",\"FieldIndex\":40"
                "},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"BidInvitationProjectSaleAmount\",\"TargetType\":\"1\",\"FieldValue\":\"\",\"FieldName\":\"\\xE6\\x8B\\x9B\\xE6\\x8B\\x8D\\xE6\\x8C\\x82\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":50},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"UnBidInvitationProjectSaleAmount\",\"TargetType\":\"1\","
                "\"FieldValue\":\"\",\"FieldName\":\"\\xE9\\x9D\\x9E\\xE6\\x8B\\x9B\\xE6\\x8B\\x8D\\xE6\\x8C\\x82\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\" \",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":60},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"JointCapitalSaleAmount\",\"TargetType\":\"1\",\"FieldValue\":\"\",\"FieldName\":\""
                "\\xE5\\x90\\x88\\xE8\\xB5\\x84\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\" \",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":70},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"WhollyProjectSaleAmount\",\"TargetType\":\"1\",\"FieldValue\":\"\",\"FieldName\":\"\\xE5\\x85\\xA8\\xE8\\xB5\\x84\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\" \",\""
                "Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":80}]},\"ChildCorpTargets\":[{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"CorpName\":\"\\xE4\\xB8\\x87\\xE5\\x9C\\xB0\\xE7\\xBD\\xAE\\xE4\\xB8\\x9A\",\"Targets\":[{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"LongProjectAmount\",\"TargetType\":2,\"FieldValue\":\"1000\",\"FieldName\":\"\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE4\\xB8\\xAA\\xE6\\x95\\xB0\",\"DataType\":2,\"Length\":0,\"Description\":\"\",\"Unit\":\""
                "\\xE4\\xB8\\xAA\",\"FieldIndex\":10},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"TotalLandArea\",\"TargetType\":2,\"FieldValue\":\"582222\",\"FieldName\":\"\\xE6\\x80\\xBB\\xE7\\x94\\xA8\\xE5\\x9C\\xB0\\xE9\\x9D\\xA2\\xE7\\xA7\\xAF\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE3\\x8E\\xA1\",\"FieldIndex\":20},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"SaleAmount\",\"TargetType\":2,\"FieldValue\":\"\",\"FieldName\":\""
                "\\xE6\\x80\\xBB\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":30},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"CapacityArea\",\"TargetType\":2,\"FieldValue\":\"\",\"FieldName\":\"\\xE6\\x80\\xBB\\xE5\\xBB\\xBA\\xE7\\xAD\\x91\\xE8\\xAE\\xA1\\xE5\\xAE\\xB9\\xE9\\x9D\\xA2\\xE7\\xA7\\xAF\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE3\\x8E\\xA1\",\"FieldIndex\":40},{"
                "\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"BidInvitationProjectSaleAmount\",\"TargetType\":2,\"FieldValue\":\"\",\"FieldName\":\"\\xE6\\x8B\\x9B\\xE6\\x8B\\x8D\\xE6\\x8C\\x82\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\"\",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":50},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"UnBidInvitationProjectSaleAmount\",\"TargetType\":2,\""
                "FieldValue\":\"\",\"FieldName\":\"\\xE9\\x9D\\x9E\\xE6\\x8B\\x9B\\xE6\\x8B\\x8D\\xE6\\x8C\\x82\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\" \",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":60},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"JointCapitalSaleAmount\",\"TargetType\":2,\"FieldValue\":\"\",\"FieldName\":\""
                "\\xE5\\x90\\x88\\xE8\\xB5\\x84\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\" \",\"Unit\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":70},{\"CorpId\":\"194bd04d-b4ab-435a-899f-6e66db01d8f2\",\"FieldId\":\"WhollyProjectSaleAmount\",\"TargetType\":2,\"FieldValue\":\"\",\"FieldName\":\"\\xE5\\x85\\xA8\\xE8\\xB5\\x84\\xE9\\xA1\\xB9\\xE7\\x9B\\xAE\\xE8\\xB4\\xA7\\xE5\\x80\\xBC\",\"DataType\":3,\"Length\":0,\"Description\":\" \",\"Unit"
                "\":\"\\xE4\\xB8\\x87\\xE5\\x85\\x83\",\"FieldIndex\":80}]}],\"Attachments\":[{\"FilePath\":\"Attachments\\\\\\\\Data\\\\\\\\5a0a7232-e42f-4dc4-8424-961c6ee85956.pdf\",\"FileName\":\"ManualGuide\",\"FileSize\":11802609,\"Extension\":\".pdf\",\"UploadDate\":\"2018-04-11T18:13:12.2661376+08:00\",\"Uploader\":\"test01\",\"UploaderId\":\"20e11dba-7615-4c6e-8518-f4d5429792d3\"}],\"saveType\":2,\"Month\":0}",
                LAST);        

上面是请求的内容,需要对里面的planName1和2016进行参数化,该怎么弄呢?
作者: qqq911    时间: 2018-4-18 11:04
鼠标右键,参数化
作者: luozhi4102    时间: 2018-5-2 11:07
鼠标右键参数化不成功呢
作者: luozhi4102    时间: 2018-5-2 11:07
使用Lr_eval_string()读取参数,并使用lr_convert_string_encoding转换编码,再用strcat拼接BodyBinary,参数带入了,但是请求提交失败




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2