51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3753|回复: 5
打印 上一主题 下一主题

[Robot] robot中如何根据脚本确定VU一个提交事务

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2004-11-19 18:17:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我录制了一个脚本,其中有登录、新建、保存等等功能,但我想提起击“保存”到保存执行结果的时间,在编辑脚本时不知这个事务开始到底该插在什么地方,谢谢!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏

该用户从未签到

2#
发表于 2004-11-19 18:17:59 | 只看该作者
分析脚本

你把脚本贴出来,也许可以帮你解决
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2004-11-22 13:22:28 | 只看该作者
我是以前的wzh123,不知为何登录不上了,所以又重机关报注册了一个
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2004-11-22 13:25:49 | 只看该作者
#include <VU.h>
{
push Http_control = HTTP_PARTIAL_OK | HTTP_CACHE_OK | HTTP_REDIRECT_OK;
push Timeout_scale = 200; /* Set timeouts to 200% of maximum response time */
push Think_def = "LR";
Min_tmout = 120000;       /* Set minimum Timeout_val to 2 minutes          */
push Timeout_val = Min_tmout;


push Think_avg = 0;

start_time ["begin_login"];

cpc_test1_zte_com_cn = http_request ["Script_~001"] "10.30.2.4:9080",
     HTTP_CONN_DIRECT,
     "POST /CPCWeb/servlet/UserServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 595\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000b`loginVerifysr`0019`com.zte.ecc.web.util.User`beb8148127"
     "90e2b30200145a000d`isLeaderTitleZ`0009`isloginokJ`0006`teamIdJ`0008`tea"
     "mRoleL`0006`areaIdt`0012`Ljava/lang/String;L`000c`departmentIdq`007e0007"
     "4c000e`departmentNameq`007e00074c0006`deptNoq`007e00074c000d`deptShortN"
     "ameq`007e00074c0005`emailq`007e00074c0007`isAdminq`007e00074c000c`login"
     "messageq`007e00074c0005`orgIdq`007e00074c0007`orgNameq`007e00074c0008`p"
     "asswordq`007e00074c0006`sectIdq`007e00074c0008`sectNameq`007e00074c0003`u"
     "idq`007e00074c0006`userIdq`007e00074c0008`userNameq`007e0007`xp`00000000"
     "0000000000000000000000000000`ppppppppppt`000c`200409128164pppt`0006`128"
     "164pppppppppx";


set Server_connection = cpc_test1_zte_com_cn;

http_header_recv ["Script_~002"]  200;  /* OK */

http_nrecv ["Script_~003"]  100 %% ;    /* 715 bytes */
/*set Think_avg = 2407;

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~004"]
     "POST /CPCWeb/servlet/ProjectServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 259\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000e`getProjectListsr`0011`java.lang.Integer`12e2a0a4f7818738"
     "020001490005`valuexr`0010`java.lang.Number`86ac951d0b94e08b020000`xp`003e"
     "fda4`ppppppppx";

http_header_recv ["Script_~005"]  200;  /* OK */

http_nrecv ["Script_~006"]  100 %% ;    /* 2397 bytes */
/*set Think_avg = 203;

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~007"]
     "POST /CPCWeb/servlet/BaseDataServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 188\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000c`calenderListt`0005`10401ppppppppx";

http_header_recv ["Script_~008"]  200;  /* OK */

http_nrecv ["Script_~009"]  100 %% ;    /* 1441 bytes */
/*set Think_avg = 172;

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~010"]
     "POST /CPCWeb/servlet/BaseDataServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 188\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a740011`projectStatusListt`0000`ppppppppx";

http_header_recv ["Script_~011"]  200;  /* OK */

http_nrecv ["Script_~012"]  100 %% ;    /* 1357 bytes */
/*set Think_avg = 15;

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~013"]
     "POST /CPCWeb/servlet/BaseDataServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 187\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000b`productListt`0005`10401ppppppppx";

http_header_recv ["Script_~014"]  200;  /* OK */

http_nrecv ["Script_~015"]  100 %% ;    /* 585 bytes */

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~016"]
     "POST /CPCWeb/servlet/BaseDataServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 186\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000f`deliverTeamListt`0000`ppppppppx";

http_header_recv ["Script_~017"]  200;  /* OK */

http_nrecv ["Script_~018"]  100 %% ;    /* 307 bytes */
/*set Think_avg = 391;

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~019"]
     "POST /CPCWeb/servlet/ProjectServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 186\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000a`getProductt`0005`10401ppppppppx";

http_header_recv ["Script_~020"]  200;  /* OK */

http_nrecv ["Script_~021"]  100 %% ;    /* 584 bytes */
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2004-11-22 13:26:41 | 只看该作者

上面代码还没完,继续

http_request ["Script_~022"]
     "POST /CPCWeb/servlet/BaseDataServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 180\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000b`getTaskTypepppppppppx";

http_header_recv ["Script_~023"]  200;  /* OK */

http_nrecv ["Script_~024"]  100 %% ;    /* 443 bytes */
/*set Think_avg = 16;

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~025"]
     "POST /CPCWeb/servlet/BaseDataServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 184\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000f`getTaskTypeListpppppppppx";

http_header_recv ["Script_~026"]  200;  /* OK */

http_nrecv ["Script_~027"]  100 %% ;    /* 574 bytes */
/*set Think_avg = 15;*/

/* Keep-Alive request over connection cpc_test1_zte_com_cn */
http_request ["Script_~028"]
     "POST /CPCWeb/servlet/BaseDataServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 182\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000d`getHardFactorpppppppppx";

http_header_recv ["Script_~029"]  200;  /* OK */

http_nrecv ["Script_~030"]  100 %% ;    /* 364 bytes */

http_disconnect(cpc_test1_zte_com_cn);

stop_time ["begin_login"];               /*登录结束*/

/*set Think_avg = 18390;*/

cpc_test1_zte_com_cn_1 = http_request ["Script_~031"] "10.30.2.4:9080",
     HTTP_CONN_DIRECT,
     "POST /CPCWeb/servlet/ProjectServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 825\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000a`getProjectsq`007e00000000000000000002`uq`007e0003000000"
     "0a`sr`0019`com.zte.ecc.web.util.User`beb814812790e2b30200145a000d`isLea"
     "derTitleZ`0009`isloginokJ`0006`teamIdJ`0008`teamRoleL`0006`areaIdt`0012`L"
     "java/lang/String;L`000c`departmentIdq`007e00094c000e`departmentNameq`007e"
     "00094c0006`deptNoq`007e00094c000d`deptShortNameq`007e00094c0005`emailq`00"
     "7e00094c0007`isAdminq`007e00094c000c`loginmessageq`007e00094c0005`orgId"
     "q`007e00094c0007`orgNameq`007e00094c0008`passwordq`007e00094c0006`sectI"
     "dq`007e00094c0008`sectNameq`007e00094c0003`uidq`007e00094c0006`userIdq`00"
     "7e00094c0008`userNameq`007e0009`xp`000100000000000000000000000000000000`p"
     "t`0005`10453t`0005`IT`e983a8`ppt`0016`li.ruisheng@zte.com.cnpt`001d20e794"
     "a8e688b7e68890e58a9fe9aa8ce8af81efbc81efbc81efbc81` t`0005`10401t`000ce8"
     "b4a8e4bc81e4b8ade5bf83`pt`0003`412t`000ce5a496e58d8fe5bda9e7bb8374000c`2"
     "00409128164t`0007`4128164t`0009e69d8ee7919ee8839c`sr`0011`java.lang.Int"
     "eger`12e2a0a4f7818738020001490005`valuexr`0010`java.lang.Number`86ac951d"
     "0b94e08b020000`xp`0000920f`ppppppppxppppppppx";


set Server_connection = cpc_test1_zte_com_cn_1;

http_header_recv ["Script_~032"]  200;  /* OK */

http_nrecv ["Script_~033"]  100 %% ;    /* 2088 bytes */

http_disconnect(cpc_test1_zte_com_cn_1);
/*set Think_avg = 14860;*/

cpc_test1_zte_com_cn_2 = http_request ["Script_~034"] "10.30.2.4:9080",
     HTTP_CONN_DIRECT,
     "POST /CPCWeb/servlet/ProjectServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 263\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a740012`getProjectListDatasr`0011`java.lang.Integer`12e2a0a4f781"
     "8738020001490005`valuexr`0010`java.lang.Number`86ac951d0b94e08b020000`x"
     "p`0000920f`ppppppppx";

start_time ["enter_planitem"];

set Server_connection = cpc_test1_zte_com_cn_2;

http_header_recv ["Script_~035"]  200;  /* OK */

http_nrecv ["Script_~036"]  100 %% ;    /* 1372 bytes */

http_disconnect(cpc_test1_zte_com_cn_2);

stop_time ["enter_planitem"];

/*set Think_avg = 116922;*/

cpc_test1_zte_com_cn_3 = http_request ["Script_~037"] "10.30.2.4:9080",
     HTTP_CONN_DIRECT,
     "POST /CPCWeb/servlet/UserServlet HTTP/1.1\r\n"
     "Content-type: application/octest-stream\r\n"
     "Content-length: 189\r\n"
     "User-Agent: Java/1.4.2_01\r\n"
     "Host: 10.30.2.4:9080\r\n"
     "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
     "Connection: keep-alive\r\n"
     "\r\n"
     "`aced0005`sr`0010`java.util.Vector`d997`}[`803baf01030003490011`capacit"
     "yIncrementI`000c`elementCount[`000b`elementDatat`0013`[Ljava/lang/Objec"
     "t;xp`0000000000000002`ur`0013`[Ljava.lang.Object;`90ce589f10`s)l`020000`x"
     "p`0000000a74000c`get6UserDatat`0006`116662ppppppppx";

start_time ["begin_save"];

set Server_connection = cpc_test1_zte_com_cn_3;

http_header_recv ["Script_~038"]  200;  /* OK */

http_nrecv ["Script_~039"]  100 %% ;    /* 693 bytes */

http_disconnect(cpc_test1_zte_com_cn_3);

stop_time ["begin_save"];


pop [Think_def, Think_avg, Timeout_val, Timeout_scale];

pop Http_control;

}
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2004-11-22 13:30:47 | 只看该作者
在上面的代码中我自己在录制过程中插入了时间计算函数,但结果却时间开始与结束之间却什么代码都没有,而在前台界面操作时却花20秒左右,不知为什么?
   另外,这段代码我第一次运行整个时间为2分59秒,第二、三次却只有几秒钟,请问为什么,是我设置什么不正确吗
   对一个事务的判断,是否根据connection和disconnection来判断,谢谢!
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-26 22:38 , Processed in 0.064341 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表