今天用Rational TestStudio进行性能测试,由于不想老是盯着测试进行,跑完一个又要再手工跑另一个,浪费时间又无聊,于是写了一个批处理脚本来运行。谁知道一用才发现命令行方式根本对用户数的设置不起作用,有Bug!
手册中对rtmanager命令行的方式说明如下:
The following syntax shows how to run a suite from the command line:
rtmanager.exe suitename /runsuite /user userid [/password password]
/project .rsp-path [/computers [Local]; [computer-1; computer-2; computer-n]
[/computerlists computerlists] /build buildname
/logfolder logfoldername /log logname [/overwritelog] [/numusers nnn]
[/ignoreconfiguredtestcases] [/close]
/project .rsp-path [/computers [Local]; [computer-1; computer-2; computer-n]
[/computerlists computerlists] /build buildname
/logfolder logfoldername /log logname [/overwritelog] [/numusers nnn]
[/ignoreconfiguredtestcases] [/close]
完全按照手册的格式写了一个,跑是跑起来了,但是用户数的设置却死活都不行,无论怎么搞,每次总是运行一个用户,根本达不到并发。以为是Suite的设置问题,可是不管是单UserGroup还是多UserGroup,再用Scenario的方式也都无效。
最后,确终于在一次次没有头绪的尝试中搞定了,解决的方法就是--把/numusers的参数提到前面去!
格式如下:
rtmanager.exe suitename /runsuite /user userid [/password password] [/numusers nnn]
/project .rsp-path [/computers [Local]; [computer-1; computer-2; computer-n]
[/computerlists computerlists] /build buildname
/logfolder logfoldername /log logname [/overwritelog]
[/ignoreconfiguredtestcases] [/close]
/project .rsp-path [/computers [Local]; [computer-1; computer-2; computer-n]
[/computerlists computerlists] /build buildname
/logfolder logfoldername /log logname [/overwritelog]
[/ignoreconfiguredtestcases] [/close]
最后,利用start wait的方式可以实现多脚本的顺序执行,例如:
START /WAIT rtmanager.exe Suite1 /runsuite /user admin /project
"C:\Sample Project\Sample.rsp" /computers Local /build "Build 1"
/logfolder Default /log Sample1 /close