51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2451|回复: 0
打印 上一主题 下一主题

SilkPerformer教程之添加集合点

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2013-9-17 17:12:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
集合点,顾名思义,就是虚拟用户在一起集合的点,这就是为我们所谓的并发用户在做准备。
在SilkPerformer中没有直接添加集合点的图标,所以得手工输入代码来添加,用到的主函数为“GlobalWaitFor”,主要使用方法如下:
GlobalWaitFor( in sName    : string,
               in nCount   : number optional,
               in nTimeout : number optional ): number;
主要参数如下:
Parameter         Description
sName         Name to identify the checkpoint
nCount         Number of users who must reach or pass the checkpoint (optional). To specify to wait for all users, omit this parameter or specify ALL_USERS.
nTimeout         Maximum waiting time in seconds before a timeout occurs (optional). If this parameter is omitted, the timeout is set to INFINITE.
返回值如下:
•        GLOBAL_ERROR if an error like an invalid number of users at the checkpoint occurred. To get more information, call the GetLastError function.
•        GLOBAL_CANCELED if the waiting period was cancelled by the controller computer.
•        GLOBAL_TIMEOUT if the waiting period exceeded the defined timeout and the user continues the simulation.
•        GLOBAL_PASSED if all users have reached the checkpoint the user was waiting for and the user continues the simulation.
•        GLOBAL_SYNCHRONIZED if all users have reached the checkpoint the user was waiting for. The user was the last one to enter the checkpoint and continues the simulation.
举例如下:
var
  hConnection: number;
dcltrans
        //定义一个事务
  transaction TLogon
  var
        //定义一个变量来接受返回值
    nRet: number;
begin //事务开始
        //登录事务执行登录操作
  OraLogon(hConnection, "user", "password", "orclnet2");
//添加集合点并返回给nRet
  nRet := GlobalWaitFor("All are logged in", ALL_USERS, 300);
//判断返回值是否全部集合完毕
  if nRet = GLOBAL_SYNCHRONIZED then
    Print("I am the last user at the checkpoint");
  end;
        //事务结束
end TLogon;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-16 07:41 , Processed in 0.067592 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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