脚本如下

Action()
{
	int myFile;//lr不支持FILE类型,所以定义一个int类型的file

	web_reg_save_param("goods_price",//保存response回来的所需数据
						"LB=\"item-num\">",
						"RB=</div>",
						"Search=Body",
						LAST);

	web_url("buy",//访问web地址
			"URL=http://vip.baiyou100.com/1030000.asp?Product=1738",
			LAST);

 	myFile=fopen("d:\\1.txt","a+");//定义file的路径和写入方式为附加

 	fprintf(myFile,"%s\n",lr_eval_string("{goods_price}"));//写入数据

	return 0;
}

如图1,设置Run执行3次后,在生成的txt中可以看到如下图

通过loadrunner将http返回response写入文本txt中

1

通过loadrunner将http返回response写入文本txt中

2

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2022-01-14
相关资源
相似解决方案