# -*- coding: utf-8 -*-
import time
import os
#格式为小时,分钟,脚本名称(包括盘符,最好是放在根目录下)
#需要把LoadRunner安装路径的Bin加入系统参数Path下
run_time = [[16,30,'scenario1'],[17,30,'scenario2'],[17,30,'scenario2']]
while 1 == 1:
now_time = time.localtime()
now_hour = now_time.tm_hour
now_minute = now_time.tm_min
for i in range(len(run_time)):
check_hour = run_time[i][0]
check_minute = run_time[i][1]
check_scenario = run_time[i][2]
if (now_hour == check_hour) and (now_minute == check_minute):
run_bat = 'wlrun -TestPath ' + check_scenario + ' -Run'
os.system(run_bat)
场景的一些配置文件参数
Vusers=100
Result_file=D:lrScript抢钱宝脚本抢钱宝登陆 es000000 es000000.lrr
ResCleanName=res
AutoSetResults=1
AutoOverwriteResults=0
<Duration>
<StartCondition>
<PrevAction />
</StartCondition>
<RunFor>300</RunFor>
</Duration>
<Duration>
<StartCondition>
<PrevAction />
</StartCondition>
<RunFor>300</RunFor>
</Duration>