html的loadrunner脚本2
Action()
{
char buf[1911]; //¶¨Òå×Ö·ûÊý×飬Ö÷ÒªÓÃÓÚдÈëXML±¨Îĵ½»º³åÇø
char str_Body[4086]; //³Ð½Ó±¨ÎĵÄ×Ö·ûÊý×é
char strHeader[4086]; //±¨ÎÄÍ·£¬³õʼΪ16½øÖƵÄ×Ö·û´®
int offset;
char * ReturnData;
int sendLen=0; //·¢ËÍXMLµÄ³¤¶È
int len;
char temp[5];
/*******¿ª¸öÈË¿Í»§ºÅ*********/
sprintf(str_Body,"%s", lr_eval_string(
"<?xml version=\"1.0\" encoding=\"GB18030\"?>"
"<Message>"
"<Head>"
"<_TransactionId>ecif.addPerson</_TransactionId>"
"<requestHeader>"
"<version>1.0</version>"
"<serialNo></serialNo>"
"<requestId>TELLER</requestId>"
"<refSerialNo></refSerialNo>"
"<requestTime>2014-10-15 11:30:42.246</requestTime>"
"<timeOutTime></timeOutTime>"
"<channelId>123010032</channelId>" //¿Í»§¼¶±ð
"<channelSerialNo></channelSerialNo>"
"</requestHeader>"
"<control>"
"<requesterName><dptid></requesterName>" //ËùÊôÐкÅ
"<requesterRole>123010032</requesterRole>" //Óû§ËùÊôÓû§×é
"<requesterInsitution><dptid></requesterInsitution>" //ËùÊô»ú¹¹
"<requesterId><oprid></requesterId>" //¹ñÔ±ºÅ
"<requesterTime>2014-10-15 11:30:42.246</requesterTime>"
"<requesterLanguage>124010002</requesterLanguage>"
"<requesterLocale></requesterLocale>"
"<pageStartIndex></pageStartIndex>"
"<pageEndIndex></pageEndIndex>"
"<availableResultsCount></availableResultsCount>"
"<returnAvailableResultCount></returnAvailableResultCount>"
"<isAuthorize>575001001</isAuthorize>"
"<transCode></transCode>"
"</control>"
"</Head>"
"<Body>"
"<personMain>"
"<contactCode>122010001</contactCode>" //¿Í»§Àà±ð
"<contactTpCd>162010001</contactTpCd>" //¿Í»§ÊôÐÔ
"<clientTpCd>101001101</clientTpCd>"
"<contactName><ContactName></contactName>" //¿Í»§Ãû³Æ
//"<channelId>123010032</channelId>" //¿Í»§¼¶±ð
"<picId>567564</picId>" //Ó°Ïñid
"<englishName>lkjjhgj</englishName>"
"<rankTpCd>160010002</rankTpCd>"
"<hasExBizInd>575001001</hasExBizInd>"
"<dwellerInd>575001001</dwellerInd>"
"<idTpCd>109010002</idTpCd>" //¿ª»§ÖÖÀà ´ËÀàΪ»§¿Ú±¾
"<refNum><RefNum></refNum>" //¿ª»§Ö¤¼þºÅ
"<issueDt>1991-12-10</issueDt>" //¿ª»§Ö¤¼þÇ©·¢ÈÕÆÚ
"<expiryDt>2099-12-31</expiryDt>" //¿ª»§Ö¤¼þµ½ÆÚÈÕ
"<issueOrg>ÇàÑòÇø¹«°²·Ö¾Ö</issueOrg>"
"<workAddr>ÐÜè»ùµØ</workAddr>"
"<workAddrOneKey>510000000000</workAddrOneKey>"
"<workAddrOneValue>ËÄ´¨Ê¡</workAddrOneValue>"
"<workAddrTwoKey>510100000000</workAddrTwoKey>"
"<workAddrTwoValue>³É¶¼ÊÐ</workAddrTwoValue>"
"<workAddrThreeKey>510105000000</workAddrThreeKey>"
"<workAddrThreeValue>ÇàÑòÇø</workAddrThreeValue>"
"<familyAddr>Ì츮¹ã³¡</familyAddr>"
"<familyAddrOneKey>510000000000</familyAddrOneKey>"
"<familyAddrOneValue>ËÄ´¨Ê¡</familyAddrOneValue>"
"<familyAddrTwoKey>510100000000</familyAddrTwoKey>"
"<familyAddrTwoValue>³É¶¼ÊÐ</familyAddrTwoValue>"
"<familyAddrThreeKey>510105000000</familyAddrThreeKey>"
"<familyAddrThreeValue>ÇàÑòÇø</familyAddrThreeValue>"
"<familyAddrPostalCode>610000</familyAddrPostalCode>"
"<email>adsf@sina.com</email>"
"<phone>13109876789</phone>"
"<mobile>13109876789</mobile>"
"<workPhone>02888889090</workPhone>"
"<fax>02888889900</fax>"
"<bonCountryTpCd>111010045</bonCountryTpCd>"
"<langTpCd>124010002</langTpCd>"
"<incomeSrcScopeTpCd>120010007</incomeSrcScopeTpCd>"
"<maritalTpCd>128010002</maritalTpCd>"
"<farmerInd>575001001</farmerInd>" //Å©»§±êÖ¾
"<rentRightTpCd>180010001</rentRightTpCd>"
"<nationTpCd>119010001</nationTpCd>" //Ãñ×å
"<faithTpCd>121010002</faithTpCd>" //×Ú½ÌÐÅÑö
"<maritalDt>2001-12-12</maritalDt>"
"<investTropism>æØÈý´ó·¨</investTropism>"
"<investRiskTpCd>125010001</investRiskTpCd>"
"<acceptMsgInd>575001001</acceptMsgInd>"
"<investKnowage>¹«Òæ¹ã¸æ</investKnowage>" //Ͷ×ÊÐËȤ
"<investYears>4</investYears>"
"<workAddrPostalCode>610001</workAddrPostalCode>"
"<preCountryTpCd>111010045</preCountryTpCd>"
"<bankStockholderInd>575001001</bankStockholderInd>"
"<workOrgName>º£ÄÏÊ¡³ÎÂõÏع«Ë¾</workOrgName>"
"<occupationTpCd>116010003</occupationTpCd>"
"<custLvlCd>603000001</custLvlCd>"
"<naecdpName>D01</naecdpName>"
"<creditInd>575001001</creditInd>"
"<creditLines>232</creditLines>"
"<loanBalance>2323</loanBalance>"
"<offBalance>3232</offBalance>"
"<usedLines>2121</usedLines>"
"<agencyInd>575001002</agencyInd>"
"<agcontactName>Ðì½õ</agcontactName>" //´úÀíÈË¿Í»§Ãû³Æ
"<agidTpCd>109010002</agidTpCd>" //´úÀíÈËÖ¤¼þÀàÐÍ
"<agrefNum>1000100010002</agrefNum>" //´úÀíÈËÖ¤¼þºÅ
"<agissueDt>2010-12-21</agissueDt>" //´úÀíÈËÖ¤¼þÇ©·¢ÈÕÆÚ
"<agexpiryDt>2099-12-31</agexpiryDt>" //´úÀíÈËÖ¤¼þµ½ÆÚÈÕ
"<agissueOrg>º£ÄÏÊ¡³ÎÂõÏؽð½Õò</agissueOrg>"
"<agnetworkCheckInd>175010003</agnetworkCheckInd>"
"<agbonCountryTpCd>111010045</agbonCountryTpCd>"
"<agphone>0288888887</agphone>" //ÁªÏµµç»°
"<agAddr>º£ÄÏÊ¡³ÎÂõÏØ</agAddr>" //ÁªÏµµØÖ·
"<addrTpCd>567001001</addrTpCd>" //Óʱà
"<riskLevelTpCd>534001003</riskLevelTpCd>"
"<riskLevelDesc>¿ª»§²âÊÔ..</riskLevelDesc>"
"<riskLevelCreatDt>2014-10-16</riskLevelCreatDt>"
"<industryTpCd>T</industryTpCd>"
"</personMain>"
"</Body>"
"</Message>"
));
//È¡±¨ÎÄÌåµÄ³¤¶È
len=strlen(str_Body);
lr_output_message("%d",len);
itoa(len,temp,10);
if (len<10){
strcpy(strHeader,"0000000");
strcat(strHeader,temp);
lr_output_message("%s",strHeader);
}else if(len>10 &&len<100){
strcpy(strHeader,"000000");
strcat(strHeader,temp);
lr_output_message("%s",strHeader);
}else if(len>100 &&len<1000){
strcpy(strHeader,"00000");
strcat(strHeader,temp);
lr_output_message("%s",strHeader);
}else if(len>1000 &&len<10000){
strcpy(strHeader,"0000");
strcat(strHeader,temp);
lr_output_message("%s",strHeader);
}else if(len>10000 &&len<100000){
strcpy(strHeader,"000");
strcat(strHeader,temp);
lr_output_message("%s",strHeader);
}else{
lr_output_message("³¤¶ÈΪÆäËüÊý×Ö");
}
strcat(strHeader,str_Body);
lr_output_message("%s",strHeader);
//±ê¼ÇÊÂÎñ¿ªÊ¼
lr_start_transaction("¿ª¸öÈË¿Í»§_socket");
/*½¨Á¢socket£¬ÓÃÓÚ½¨Á¢Á¬½Ó£¬½øÐз¢ËͺͽÓÊÕ±¨ÎÄ*/
lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=172.32.7.8:18002", LrsLastArg);//ÃŹñ50000 ¿¨ÏµÍ³50003 //ecif 172.32.7.8 :8002//172.32.2.6:19013
// lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=172.32.2.3:19013", LrsLastArg);//ÃŹñ50000 ¿¨ÏµÍ³50003 //172.32.2.6:19013
strcpy(buf,strHeader);
lr_output_message("%s",buf);
lrs_set_send_buffer("socket0",buf,strlen(buf));
//·¢Ëͱ¨ÎÄ
lrs_send("socket0", "buf0",LrsLastArg);
/*½ÓÊÕ·µ»ØµÄ±¨ÎÄ,Ö¸¶¨»º³åºÍ³¤¶È*/
lrs_receive("socket0", "buf1",LrsLastArg);
//lrs_receive("socket0", "buf1","Flags= MSG_PEEK",LrsLastArg);
//lrs_receive_ex("socket0", "buf1","NumberOfBytesToRecv=4086",LrsLastArg);
ReturnData=lrs_get_received_buffer("socket0",0,-1,"ascii");
lr_output_message("·µ»Ø±¨ÎÄ[%s]",ReturnData);
//if(strstr(ReturnData,"<RetMessage>½»Ò׳ɹ¦</RetMessage>"))
if(strstr(ReturnData,"<responseCode>000000</responseCode>"))
{
lr_output_message("¿ª¸öÈË¿Í»§³É¹¦");
lr_end_transaction("¿ª¸öÈË¿Í»§_socket", LR_PASS);
}
else
{
lr_error_message("¿ª¸öÈË¿Í»§Ê§°Ü:ÐÕÃû[%s],Ö¤¼þºÅ[%s]",lr_eval_string("<ContactName>"),lr_eval_string("<RefNum>"));
lr_end_transaction("¿ª¸öÈË¿Í»§_socket", LR_FAIL);
lrs_close_socket("socket0");
return 0;
}
lrs_close_socket("socket0");
return 0;
}
html的loadrunner脚本2的更多相关文章
- LoadRunner脚本编写(转)
性能测试工程师要懂代码么?答案是必须的.好多测试员认为在loadrunner中编写脚本很难很牛X ,主要是大多测试人员并未做过开发工作,大学的那点程序基础也忘记的差不多了.还有非计算机专业出身的测试员 ...
- LoadRunner脚本实例来验证参数化的取值
LoadRunner脚本实例来验证参数化的取值 SINM {3]!G0问题提出: 主要想试验下,在Controller中,多个用户,多次迭代中参数的取值.51Testing软件测试网(['H5f,d ...
- Loadrunner脚本录制常见问题整理
1.LoadRunner录制脚本时为什么不弹出IE浏览器? 当一台主机上安装多个浏览器时,LoadRunner录制脚本经常遇到不能打开浏览器的情况,可以用下面的方法来解决. 启动浏览器,打开Inter ...
- LoadRunner脚本设计、场景设计和结果分析
本次笔记主要记录LoadRunner脚本设计.场景设计和结果分析 1. 脚本设计 录制模式 手工模式:插入步骤.手动编写 1.1 脚本增强: ...
- [转]LoadRunner脚本录制常见问题整理
LoadRunner脚本录制常见问题整理 1.LoadRunner录制脚本时为什么不弹出IE浏览器? 当一台主机上安装多个浏览器时,LoadRunner录制脚本经常遇到不能打开浏览器的情况,可以用下面 ...
- 关注LoadRunner脚本回放日志中的Warning信息-转载
关注LoadRunner脚本回放日志中的Warning信息 最近在与大家的讨论中发现了LoadRunner的很多问题,出于解决问题的出发点,我也就相关自己不理解的问题在Google中搜索了一番,并 ...
- 转:如何在 LoadRunner 脚本中做关联 (Correlation)
如何在 LoadRunner 脚本中做关联 (Correlation) 当录制脚本时,VuGen会拦截client端(浏览器)与server端(网站服务器)之间的对话,并且通通记录下来,产生脚本.在V ...
- 老李分享:Eclipse中开发性能测试loadrunner脚本
老李分享:Eclipse中开发性能测试loadrunner脚本 前篇我分享了如何用loadrunner搭建javauser的性能测试脚本环境,本次我来告诉大家如何在eclipse开发loadrunne ...
- LoadRunner脚本准备
脚本录制1.启动LoadRunner2.打开VuGen在LoadRunner Launcher窗格中,单击创建/编辑脚本3.创建一个空白Web脚本在“新建虚拟用户”对话框里选择新建脚本的协议一般选择W ...
- loadrunner 脚本优化-事务时间简介
脚本优化-事务时间简介 by:授客 QQ:1033553122 事务概念 事务是指用户在客户端做一种或多种业务所需要的操作集(actions),通过事务开始和结束函数可以标记完成该业务所需要的操作内容 ...
随机推荐
- BZOJ3747 POI2015Kinoman(线段树)
考虑固定左端点,求出该情况下能获得的最大值.于是每次可以在某数第一次出现的位置加上其价值,第二次出现的位置减掉其价值,查询前缀最大值就可以了.每次移动左端点在线段树上更新即可. #include< ...
- [SHOI2011]双倍回文 manacher
题面: 洛谷:[SHOI2011]双倍回文‘ 题解: 首先有一个性质,本质不同的回文串最多O(n)个. 所以我们可以对于每个i,求出以这个i为结尾的最长回文串,然后以此作为长串,并判断把这个长串从中间 ...
- 我是一个CPU:这个世界慢!死!了!
最近小编看到一篇十分有意思的文章,多方位.无死角的讲解了CPU关于处理速度的理解,看完之后真是豁然开朗.IOT时代,随着科技的发展CPU芯片的处理能力越来越强,强大的程度已经超乎了我们的想象.今天就把 ...
- Codeforces Round #338 (Div. 2) B dp
B. Longtail Hedgehog time limit per test 3 seconds memory limit per test 256 megabytes input standar ...
- STL源码分析-function
http://note.youdao.com/noteshare?id=269e16541b43095eaf97636d4e046b1d
- IIS最大并发连接数
最大并发连接数 = 队列长度 + 工作线程数 [工作线程数] IIS实际可以第一时间处理的请求数.比如,工作线程数 = 100,一万个连接请求同时涌过来,那么只有100个可以被处理,其余9900个进入 ...
- 解决vue路由与锚点冲突
传统的锚点定位会与vue-router中的路由设置存在冲突,解决方法自定义锚点跳转: html: <ul> <li><a href="" @click ...
- CF540 C BFS 水
'.'->'X' 前者走后变成后者,后者除了是终点不能再走.初始位置是X很傻的以为这样从初始点走出去后初始位置就变成不能走了,实际上是还能走一次的. 其他就是BFS,路上记得把路变成X就好了 太 ...
- Java--图片浏览器
功能:启动后选择打开文件,可以打开图片进行浏览. v 1.0 :支持上一张 下一张功能.(欠缺,窗口大小未随着图片大小而改变) import java.awt.BorderLayout; import ...
- sql分页demo
ALTER proc [dbo].[ProcGetUserInfoPageInfoByUserName] ), @PageIndex int, @PageSize int as Begin selec ...