性能测试脚本自动建立测试datapool应用
为了说明问题。我用分别用vb,delphi, DotNETMILY: 宋体">实现一个简单添加用户的功能,后台用ACCESS数据库,例用ado通过odbc连接。
1. 分析程序实现的结构,是简单的c/s结构,利用odbc连接。并且客户端,服务器端都配置在一台计算机。(请注意这个是条件,我们第二步选择的基础)
2. 设置session Record Options
录制方法选择api record录制,协议用odbc。(如果我后台换sqlserver或则oracle,其他实现方式不变,应该选择什么协议,因该添加什么协议)
3. Vb,delphi编码方式的功能脚本录制成功(创建同名datapool)。DotNet脚本录制成功,却无法产生同名的datapool(怎么办)。不成功脚本如下:
/*
->-> Session File Information <-<-
Created: Sun Apr 25 23:24:36 2004
Name: G:\Program\robot\lead\TestDatastore\DefaultTestscrīptDatastore\TMS_Sessions\demo.wch
Type: Rational Robot - API
(with ODBC)*/
myE._v%r2O0#include <VU.h>
{
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;
/* No Datapool Items Remain */
/* After All Data Analyses. */
VBNETDemo = sqlconnect("VBNETDemo", "", LOOKUP_PWD,
"VBNETDemo", "odbc",
"DRIVER_INFO='DSN=?;;UID=DEFAULT;PWD=DEFAULT;'");
/*{ INFO SERVER "UNKNOWN"="0.0.0.0"; } */
/* Unable to determine Server Name/Address */
set Server_connection = VBNETDemo;
push Think_avg = 0;
stmt_2_1_id = sqlopen_cursor ["pre001"] "", "select * from login";
set Think_avg = 313;
push CS_blocksize = 1;
sqlfetch_cursor ["pre002"] stmt_2_1_id, ALL_ROWS;
set Think_avg = 0;
&^ aW^R ^R+S0
sqlclose_cursor ["pre003"] stmt_2_1_id ;
set Think_avg = 4078;
stmt_2_2_id = sqlopen_cursor ["pre004"] "", "INSERT INTO `login` (`name`,`password`) VALUES (?,?)",
"'f\002'<varchar(50):I>",
"'f\002'<varchar(50):I>";
set Think_avg = 0;软件测试专业网站:51Testing软件测试网K6T HV0asm-P
软件测试专业网站:51Testing软件测试网|d*|0W+t3m9`v
sqlfree_cursor( stmt_2_2_id );软件测试专业网站:51Testing软件测试网!w9h2MO1_wv$GI
软件测试专业网站:51Testing软件测试网8U.h#m8Ub.^gP
set Think_avg = 2781;软件测试专业网站:51Testing软件测试网&o%d _UKN"@1i
文章来源于领测软件测试网 https://www.ltesting.net/