博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LoadRunner关联的高级应用
阅读量:6897 次
发布时间:2019-06-27

本文共 1045 字,大约阅读时间需要 3 分钟。

Action()
{


int array_len ,i=1;
char array_name[20];

  //通过关联找出所有的省市的连接地址

web_reg_save_param("outFlightVal",
"LB=\"http:\/\/a.lietou.com\/",
"RB=.shtml\">",
"ORD=ALL",
LAST);
web_url("a.lietou.com",
"URL=http://a.lietou.com",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t25.inf",
"Mode=HTML",
EXTRARES,
LAST);

  //计算获取省市的个数,为下面的循环访问做准备

array_len=atoi(lr_eval_string("{outFlightVal_count}"));
lr_output_message("%d",array_len);
for (i=1;i<=array_len;i++) {

  //拼接省市请求url

sprintf(array_name,"{outFlightVal_%d}",i);
lr_output_message("%s",lr_eval_string(array_name));
lr_save_string(lr_eval_string(array_name),"shen");

  //关联获取title字段内容

web_reg_save_param("title",
"LB=<title>",
"RB=</title>",
"ORD=1",
LAST);

  //关联获取content字段内容

web_reg_save_param("content",
"LB=content=",
"RB=\/>\r\n",
"ORD=1",
LAST);
web_url("a.lietou.com",
"URL=http://a.lietou.com/{shen}.shtml",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t25.inf",
"Mode=HTML",
EXTRARES,
LAST);
}
return 0;
}

   

最新内容请见作者的GitHub页:http://qaseven.github.io/

   

转载地址:http://okjdl.baihongyu.com/

你可能感兴趣的文章
[Erlang 0083] All about Erlang Shell
查看>>
EMF介绍系列(一、EMF与MDA)
查看>>
PyQt4 py2exe 打包 HardwareManager
查看>>
免费Gif图片录制工具
查看>>
Java 使用pipeline对redis进行批量读写
查看>>
【spring boot】配置文件 application.properties 属性解析
查看>>
Magicodes.WeiChat——使用AntiXssAttribute阻止XSS(跨站脚本攻击)攻击
查看>>
java多线程之:线程对象一些api
查看>>
丁夏畦同志去世
查看>>
技术方案之外你还能做什么
查看>>
是什么让C#成为最值得学习的编程语言
查看>>
不同机具的通用的第二代居民身份证读写
查看>>
【Cocos2d-x】Cocos2d-X网络编程-HttpRequest/HttpClient/HttpResponse
查看>>
用SQL语句,删除掉重复项只保留一条
查看>>
阿里云CDN直播架构与双11晚会直播实战
查看>>
辗转相除法_欧几里得算法_java的实现(求最大公约数)
查看>>
No bean named &#39;transactionManager&#39; is defined
查看>>
spring cloud config 入门
查看>>
[20171110]toad 小技巧.txt
查看>>
C#开发SQLServer的Geometry和Geography存储
查看>>