Chinaunix首页 | 论坛 | 博客
  • 博客访问: 734731
  • 博文数量: 769
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 4985
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:37
文章分类

全部博文(769)

文章存档

2011年(1)

2008年(768)

我的朋友

分类:

2008-10-15 16:44:27

  LoadRunner中HTTP的录制及两种录制模式的比较

  一,脚本编写

  1, “HTML –base scrīpt”和“URL-base scrīpt”的区别

  1)“HTML –base scrīpt”默认模式,为每个用户请求生成单独的函数

  如:

  Action()

  {

  web_url("WebTours",

  "URL=",

  "Resource=0",

  "RecContentType=text/html",

  "Referer=",

  "Snapshot=t4.inf",

  "Mode=HTML",

  LAST);

  web_submit_form("login.pl",

  "Snapshot=t5.inf",

  ITEMDATA,

  "Name=username", "Value=jojo", ENDITEM,

  "Name=password", "Value=bean", ENDITEM,

  "Name=login.x", "Value=53", ENDITEM,

  "Name=login.y", "Value=13", ENDITEM,

  LAST);

  return 0;

  }

  2)“URL-base scrīpt”可以捕获所有作为用户操作的结果发送到的HTTP请求,然后一一记录下来。可以捕获非HTML应用程序,例如小程序和非浏览器应用程序。

  如:

  Action()

  {

  web_url("WebTours",

  "URL=",

  "Resource=0",

  "RecContentType=text/html",

  "Referer=",

  "Snapshot=t1.inf",

  "Mode=HTTP",

  LAST);

  web_concurrent_start(NULL);

  web_url("header.html",

  "URL=header.html",

  "Resource=0",

  "RecContentType=text/html",

  "Referer=",

  "Snapshot=t2.inf",

  "Mode=HTTP",

  LAST);

  web_url("welcome.pl",

  "URL=welcome.pl?signOff=true",

  "Resource=0",

  "RecContentType=text/html",

  "Referer=",

  "Snapshot=t5.inf",

  "Mode=HTTP",

  LAST);

  web_concurrent_end(NULL);

  web_concurrent_start(NULL);

  web_url("hp_logo.png",

  "URL=images/hp_logo.png",

  "Resource=1",

  "RecContentType=image/png",

  "Referer=header.html",

  "Snapshot=t3.inf",

  LAST);

  web_url("webtours.png",

  "URL=images/webtours.png",

  "Resource=1",

  "RecContentType=image/png",

  "Referer=header.html",

  "Snapshot=t4.inf",

  LAST);

  web_concurrent_end(NULL);

  web_concurrent_start(NULL);

[1]   

【责编:Luzi】

--------------------next---------------------

阅读(368) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~