手机多模块反复重启压力测试脚本

这篇具有很好参考价值的文章主要介绍了手机多模块反复重启压力测试脚本。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

双击main.py即可运行。如果有什么异常,窗口一闪而逝,可在cmd窗口下,输入main.py后回车,可以查看输出打印来debug
template_lcd.py 是写重启和查看节点的逻辑
main.py是对template_lcd.py的封装(也能封装bat脚本),它能通过adb   devices命令的输出来自动检测手机数量,将template_lcd.py中的xxxt替换为每个手机的真实序列号,并以template_lcd.py为模板,为每个手机产生一个以     序列号.py 或  序列号.bat    命名的专属脚本,所以,你可以在template_lcd.py中只考虑一个手机的情况,写对操作一个手机的操作逻辑。至于同时连接多个手机的情况,由main.py来完成。main.py会通过   os.system('start cmd /k xxx.suffix')弹一个cmd窗口执行

import time
import subprocess
import os
if 1:
    import os
    if os.name == "nt":
        os.system("")
        print("os.name=",os.name)
    print("\033[1;32m Welcome! \033[0m")

def getdevlist1():
    devlist = []
    #connectfile = os.popen('type serialno_list.txt')
    connectfile = os.popen('adb devices')
    list1 = connectfile.readlines()
    #print(list1)
    #print(len(list1))
    #print(1,len(list1)-1)
    list2=list(list1[1:len(list1)-1])
    #print(list2)
    for i in range(len(list2)):
        #print(list1[i].find('\tdevice') )
        #print(list1[i].find('\tdevice') != -1)
        #if list1[i].find('\tdevice') != -1:
            #temp = list1[i].split('\t')
        temp = list2[i].split()
        #print(22,temp,temp[0],temp[1])
        devlist.append(temp[0])
    #print(11,devlist)
    return devlist


def create_file(file1,serialno):
    (name, suffix) = os.path.splitext(file1)
    #print("name=",name,"suffix=",suffix)
    with open(file1,"r") as f1:
        cmd1=f1.read()
    #print("before: \n",cmd1)
    cmd2=cmd1.replace("xxx",serialno)
    #print("after: \n",cmd2)
    with open(str(serialno)+suffix,"w") as f2:
        print(cmd2,file=f2)


def main(file2):
    (name, suffix) = os.path.splitext(file2)
    #detect_only_once=True
    detect_only_once=False
    ret=[]
    s=set(ret)
    t=0
    total=0
    while True:
        #ret=getdevlist1()
        #print("-"*8)
        #lst1=["431f92af"] #new
        #lst1=["431f92af","aa"] #new
    
        #with open("a.txt","r") as f1:
        #    lst1=f1.readlines()
        #for i in range(len(lst1)):
        #    lst1[i]=lst1[i][0:len(lst1[i])-1]
    
        #print("111")
        #time.sleep(3)
        lst1=getdevlist1()
        #print("222")
    
        s1=set(lst1)
        #print(ret,lst1)
        #print(s,s1,s1-s,s-s1)
        
        s2=s1-s
        #print(s-s1,(s-s1)!=set())
        #print(s2,s2!=set())
        if s2!=set():
            c=0
            print("")
            for i in s2:
                total+=1
                print(f"{c}. detect new devices: \033[33m {i} \033[0m,\033[32m {total} \033[0mdevices in total")
                create_file(file2,i)
                cmd='start cmd /k xxx'+suffix
                cmd1=cmd.replace("xxx",i)
                #print(cmd)
                #print(cmd1)
                #os.popen(cmd1)
                os.system(cmd1)
                #print("cmd1=",cmd1)
                c+=1
            s=s|s1
            #print(s,s1,s1-s,s-s1)
        t+=1
        if detect_only_once:
            break
            #exit()
        print(f"\r continuously detecting! \033[32m {t} \033[0m Seconds ",end="")
        time.sleep(1)

if __name__=="__main__":
    main("template_lcd.py")
    #main("demo.py")
    #main("a.bat")

'''
import os
import time
import subprocess

#enable print with color
if 1:
    import os
    if os.name == "nt":
        os.system("")
        print("os.name=",os.name)
    print("\033[1;32m Welcome! \033[0m")

def acquire_serialno_list():
    with os.popen("adb devices","r") as p:
        r=p.read()
        f1=open("serialno_list.txt","w")
        print(r,file=f1)
        f1.close()

    f1=open("serialno_list.txt","r")
    #print(f1.read())
    #print(f1.readlines())
    ret=f1.readlines()
    #print(ret)
    #print(type(ret))
    #print(len(ret))
    #print(ret[1:])
    len1=len(ret)-2
    #print(len1)
    #print(ret[1:len1])
    ret2=ret[1:len1]
    f1.close()
    return ret2


def all_devices_do_in_cmd_window2(file1):
    (name, suffix) = os.path.splitext(file1)
    print("name=",name,"suffix=",suffix)

    ret=acquire_serialno_list()
    counter=0
    #while(len(ret)>=0):
    while(len(ret)<=0):
        counter+=1
        #print("please keep \033[32m ss \033[0m device !")
        #print("\rcurrent %d devices,please at least 1 device ! waiting...%d Seconds" % (len(ret),counter),end=" ")
        print("\rcurrent \033[31m %d  \033[0m devices,please at least 1 device ! waiting...%d Seconds" % (len(ret),counter),end=" ")
        #os.system("ping -n 1 127.0.0.1 >nul")
        time.sleep(1)
        ret=acquire_serialno_list()
    print("")
    no_list=[]
    for i in ret:
        #print("mei hang shu ju: ",i)
        sp=i.split()
        #print("mei hang chai fen hou: ",sp)
        #print("no= ",sp[0])   
        no_list.append(sp[0])
    #print("no_list = ",no_list)
    #print("there are %d devices !" % len(ret))
    #print("there are   %d   devices ! the serialno are:" % len(no_list))
    print("there are \033[32m  %d   \033[0m devices! the serialno are:" % len(no_list))
    c=0
    for  i in no_list:
        print(c,".  ",i)
        c+=1
    c=0
    f3=open(name+"_do.bat","w")
    for i in no_list:
        print("---the %d  device---" % c)
        # zhe li gai xi tong ming ling 
        #os.system("ls %s" % (i))
        with open(file1,"r") as f1:
            cmd1=f1.read()
        print("before: \n",cmd1)
        cmd2=cmd1.replace("xxx",i)
        print("after: \n",cmd2)
        with open(str(i)+suffix,"w") as f2:
            print(cmd2,file=f2)
        #os.popen(cmd2)
        #subprocess.run(' {}'.format( cmd2), shell=True, capture_output=True,universal_newlines=True)
        s1 = 'start cmd /k "{}"'.format(str(i)+suffix) 
        #print('start cmd /k "{}"'.format(cmd2))
        print(s1)
        print(s1,file=f3)
        #ret=subprocess.run(' {}'.format( cmd2), shell=True, capture_output=True,universal_newlines=True)
        #print(cmd2)

        #os.popen("adb -s %s reboot autodloader" % i)
        #print("adb -s %s reboot autodloader" % i)
        print("---the %d  device---" % c)
        c+=1
    f3.close()
    os.startfile(name+"_do.bat")


all_devices_do_in_cmd_window2("template_lcd.py")
print('ab')
#all_devices_do_in_cmd_window2("tp_self-test.bat")
exit()
'''
 

import os
import re
import time
import subprocess

#enable print with color
if 1:
    import os
    if os.name == "nt":
        os.system("")
        print("os.name=",os.name)
    print("\033[1;32m Welcome! \033[0m")

counter=0
setting={
        #"lcd":{"open":True,"version":"userdebug"},
        "lcd":{"open":True,"version":"pv"},
        #"tp":{"open":False,},
        "tp":{"open":True,},
        "finger":{"open":True,},
        "sensor":{"open":True,},
        }
d={"test_item":"error_count","lcd":0,"tp":0,"finger":0,"sensor":0}
version="pv"
#version="userdebug"
 
def clean_old_files():
    #checking if file exist or not
    list1=["xxx_lcd.txt",
           "xxx_tp.txt",
           "xxx_finger.txt",
           "xxx_sensor.txt"]
    for i in list1:
        #print(i)
        if(os.path.isfile(i)):
            os.remove(i)
            #Printing the confirmation message of deletion
            #print(i,"Deleted successfully")
            print("\033[32m {} Deleted successfully \033[0m".format(i))
        else:
            #print(i,"does not exist")
            print("\033[32m {} does not exist \033[0m".format(i))


def clean_old_files2():
    #originfiles = {"template_lcd.py","main.py","ReadMe.txt","b.py","a.py"}
    originfiles = {"template_lcd.py","main.py","ReadMe.txt"}
    needDelete =  set(os.listdir(os.path.curdir))- originfiles
    #print(needDelete)
    for filename in needDelete:
       os.remove(filename)
       print("\033[32m {} Deleted successfully \033[0m".format(filename))


def get_phone_time():
    cmdtask= subprocess.run(' {}'.format("adb -s xxx shell date"), shell=True, capture_output=True,universal_newlines=True)
    return cmdtask.stdout


def show_result():
    print("-"*32)
    for i in d:
        if d[i]=="error_count":
            print("|  \033[33m {0:^10} \t {1:^10} \033[0m  |".format(i,d[i]))
        elif d[i]==0:
            print("|  {0:^10} \t \033[32m {1:^10} \033[0m  |".format(i,d[i]))
        else:
            print("|  {0:^10} \t \033[31m {1:^10} \033[0m  |".format(i,d[i]))
    print("-"*32)


def perform_by_subprocess(item,cmd_list):
    filename="xxx_"+item+".txt"
    #print("filename=",filename)
    with open(filename,"a") as f1:
        print("counter=",counter," \t phone time=",get_phone_time(),file=f1)
        for i in cmd_list:
            cmdtask= subprocess.run(' {}'.format(i), shell=True, capture_output=True,universal_newlines=True)
            print(cmdtask.stdout,file=f1)
            print("\033[33m counter=",counter," ",item,": \033[0m ",i,"=",cmdtask.stdout,"\033[36m phone time=",get_phone_time(),"\033[0m")
    return cmdtask.stdout

def detect_connect():
    cmdtask= subprocess.run(' {}'.format("adb devices"), shell=True, capture_output=True,universal_newlines=True)
    #print(cmdtask.stdout)
    t=0
    while("xxx" not in cmdtask.stdout):
        t+=1
        print("\r \033[31m xxx not connect! \033[0m waiting...\033[32m %d \033[0m Seconds" % t,end=" ")
        time.sleep(1)
        cmdtask= subprocess.run(' {}'.format("adb devices"), shell=True, capture_output=True,universal_newlines=True)
    print("")


def wait(wait_time):
    for i in range(wait_time):
        #print("\rwaiting ...{} Seconds left  ".format(wait_time-i),end='')
        print("\rwaiting ...\033[33m {}\033[0m Seconds left     ".format(wait_time-i),end='')
        time.sleep(1)
    print("\n")


def reboot():
    global counter
    while True:
        counter+=1
    ####################### lcd
        #open lcd test
        if setting["lcd"]["open"] :
            if setting["lcd"]["version"]=="pv":   
                cmds=[
                        "adb -s xxx shell charge_disable.sh",
                        "adb -s xxx shell enter_lpm.sh",
                        "adb -s xxx shell cat /proc/driver/lcd_id",
                        "adb -s xxx shell cat /proc/cmdline",
                        ]
            elif setting["lcd"]["version"]=="userdebug":
                cmds=[
                        "adb -s xxx shell cat /proc/driver/lcd_id",
                        "adb -s xxx shell cat /proc/cmdline",
                        ]            
            ret=perform_by_subprocess("lcd",cmds)
    
            #print("ret=",ret)
            #ret=""
            lcd_is_error="lcd_dummy" in ret or ret ==""
            #print("lcd_is_error=",lcd_is_error)
            if (lcd_is_error):
                d["lcd"]+=1
            ret2=re.search(r"lcd_name\S+",ret)
            #print("ret2=",ret2)
            if ret2!=None:
                print("\033[33m counter=",counter,"  lcd : \033[0m ",ret2.group(),"\033[36m phone time=",get_phone_time(),"\033[0m")
                with open("xxx_lcd.txt","a") as f1:
                    print(ret2.group(),"\n",file=f1)
    ####################### lcd
    
    ####################### tp
        if setting["tp"]["open"]:               
            cmds=[
                    "adb -s xxx shell tpdtest",
                    ]
            ret=perform_by_subprocess("tp",cmds)
            #time.sleep(8)
    ####################### tp
    
    ####################### finger
        if setting["finger"]["open"]:   
            cmds=[
                    'adb -s xxx shell "getprop | grep vendor.fingerprint.id"',
                    ]
            ret=perform_by_subprocess("finger",cmds)
    
            finger_is_error="Unknown" in ret or ret==""
            #print("finger_is_error=",finger_is_error)
            if (finger_is_error):
                d["finger"]+=1
    ####################### finger
    
    ####################### sensor
        if setting["sensor"]["open"]:               
            cmds=[
                    'adb -s xxx shell "dumpsys sensorservice | grep accelerometer"',
                  'adb -s xxx shell "dumpsys sensorservice | grep Proximity"',
                  ]
            ret=perform_by_subprocess("sensor",cmds)
    ####################### sensor 
    
        show_result()
    
        cmdtask = subprocess.run(' {}'.format("adb -s xxx shell reboot"), shell=True, capture_output=True,universal_newlines=True)
        wait(40)
    
        #cmdtask= subprocess.run(' {}'.format("adb -s xxx shell cat /proc/cmdline"), shell=True, capture_output=True,universal_newlines=True)
        #print(cmdtask.stdout)
        #wait(3)

        detect_connect()

        if setting["lcd"]["open"]:
            if setting["lcd"]["version"]=="pv":
                wait(20)
                #wait(3)
                cmdtask= subprocess.run(' {}'.format("adb -s xxx shell input keyevent 26"), shell=True, capture_output=True,universal_newlines=True)
                print("adb -s xxx shell input keyevent 26")
                wait(1110)
                #wait(3)

if __name__=="__main__":
    clean_old_files()
    #clean_old_files2()
    reboot()

'''
panel_list=['tongxingda',     
           'easyquick',        
           'skyworth']    
counter=0
#print(type(cmdtask1.stdout))
with open("xxx.txt","w") as f1:
    print("",file=f1)
while True:
    counter+=1
    cmdtask = subprocess.run(' {}'.format("adb -s xxx shell reboot"), shell=True, capture_output=True,universal_newlines=True)
    print(cmdtask.stdout)
    time.sleep(40)
    print("\033[31m lcd_is_error={} \033[0m".format(lcd_is_error))
        else:
            #print("\033[32m lcd_is_error={} \033[0m".format(lcd_is_error))
    #cmdtask= subprocess.run(' {}'.format("adb -s xxx shell cat /proc/driver/lcd_id"), shell=True, capture_output=True,universal_newlines=True)
    #print(cmdtask.stdout)
    #time.sleep(1)
            print("\033[31m finger_is_error={} \033[0m".format(finger_is_error))
        else:
            print("\033[32m finger_is_error={} \033[0m".format(finger_is_error))
    cmdtask1= subprocess.run(' {}'.format("adb -s xxx shell cat /proc/driver/lcd_id"), shell=True, capture_output=True,universal_newlines=True)
    print("the",counter,"times: adb shell cat /proc/driver/lcd_id=",cmdtask1.stdout)
    with open("xxx.txt","a") as f1:
        print(cmdtask.stdout,file=f1)
        if "lcd_name" in cmdtask.stdout:
            ret=re.search(r"lcd_name\S+",cmdtask.stdout)
            print("\033[33m the ",counter,"times, lcd: \033[0m ",ret.group())
            #print(ret)
            #print(ret.span())
    #print(type(cmdtask1.stdout))
    for i in panel_list:
        if (i in cmdtask1.stdout):
            print("the ",counter,"times  ok")
            break
    else:
        print("the ",counter,"times bad !")
        break
        with open("xxx_finger.txt","a") as f1:
            print("counter=",counter," \t phone time=",get_phone_time(),file=f1)
            cmdtask= subprocess.run(' {}'.format('adb -s xxx shell "getprop | grep vendor.fingerprint.id" '), shell=True, capture_output=True,universal_newlines=True)
            print(cmdtask.stdout,file=f1)
        print("\033[33m counter=",counter,"  finger: \033[0m ",'adb -s xxx shell "getprop | grep vendor.fingerprint.id"=',cmdtask.stdout,"\033[36m phone_time=",get_phone_time(),"\033[0m")

    #finger_is_error="fpc1553" in cmdtask.stdout

    #cmdtask = subprocess.run(' {}'.format("adb -s xxx shell reboot"), shell=True, capture_output=True,universal_newlines=True)
    #print(cmdtask.stdout)
    #print("adb -s xxx shell cat /proc/cmdline is done! sleeping 40 s")
    #time.sleep(40)
for i in d:
    #print(i,"\t",d[i])
    #print("%10s \t %10s" % (i,d[i]))
    print("{0:^10} \t {1:^10} ".format(i,d[i]))
#    if (lcd_is_error or finger_is_error):
#        #print("the ",counter,"times error!")
#        print("\033[31m the {} times error!\033[0m".format(counter))
#        #break
#    else:
#        #print("the ",counter,"times  ok")
#        print("\033[32m the {} times ok\033[0m".format(counter))
        with open("xxx_sensor.txt","a") as f1:
            print("counter=",counter," \t phone time=",get_phone_time(),file=f1)
            cmdtask= subprocess.run(' {}'.format('adb -s xxx shell "dumpsys sensorservice | grep accelerometer" '), shell=True, capture_output=True,universal_newlines=True)
            print(cmdtask.stdout,file=f1)
            print("\033[33m counter=",counter,"  sensor: \033[0m ",'adb -s xxx shell "dumpsys sensorservice | grep accelerometer"= ',cmdtask.stdout,"\033[36m phone_time=",get_phone_time(),"\033[0m")
            cmdtask= subprocess.run(' {}'.format('adb -s xxx shell "dumpsys sensorservice | grep Proximity" '), shell=True, capture_output=True,universal_newlines=True)
            print(cmdtask.stdout,file=f1)
            print("\033[33m counter=",counter,"  sensor: \033[0m ",'adb -s xxx shell "dumpsys sensorservice | grep Proximity"= ',cmdtask.stdout)
    cmdtask= subprocess.run(' {}'.format("adb -s xxx shell cat /proc/cmdline"), shell=True, capture_output=True,universal_newlines=True)
    print(cmdtask.stdout)
    print("adb -s xxx shell cat /proc/cmdline is done! sleeping 1 s")
    time.sleep(1)
#with open("xxx_lcd.txt","w") as f1:
#    print("",file=f1)
        #with open("xxx_lcd.txt","a") as f1:
        #    print("counter=",counter," \t phone time=",get_phone_time(),file=f1)

        #    cmdtask= subprocess.run(' {}'.format("adb -s xxx shell cat /proc/driver/lcd_id"), shell=True, capture_output=True,universal_newlines=True)
        #    print(cmdtask.stdout,file=f1)
        #    print("\033[33m counter=",counter,"  lcd: \033[0m ","adb -s xxx shell cat /proc/driver/lcd_id=",cmdtask.stdout,"\033[36m phone_time=",get_phone_time(),"\033[0m")

        #    cmdtask= subprocess.run(' {}'.format("adb -s xxx shell cat /proc/cmdline"), shell=True, capture_output=True,universal_newlines=True)
        #    print(cmdtask.stdout,file=f1)
        #    print("\033[33m counter=",counter,"  lcd: \033[0m ","adb -s xxx shell cat /proc/cmdline=",cmdtask.stdout)

        #    lcd_is_error="lcd_dummy" in cmdtask.stdout or cmdtask.stdout ==""
        #    #print("lcd_is_error=",lcd_is_error)
        #    if (lcd_is_error):
        #        d["lcd"]+=1
        #    ret=re.search(r"lcd_name\S+",cmdtask.stdout)
        #    #print("ret=",ret)
        #    if ret!=None:
        #        print("\033[33m counter=",counter,"  lcd: \033[0m ",ret.group())
        #        print(ret.group(),"\n",file=f1)

        #    cmdtask= subprocess.run(' {}'.format("adb -s xxx shell charge_disable.sh"), shell=True, capture_output=True,universal_newlines=True)
        #    #print(cmdtask.stdout,file=f1)
        #    print("\033[33m counter=",counter,"  lcd: \033[0m ","adb -s xxx shell charge_disable.sh=",cmdtask.stdout)
#        with open("xxx_tp.txt","a") as f1:
#            print("counter=",counter," \t phone time=",get_phone_time(),file=f1)
#            cmdtask= subprocess.run(' {}'.format('adb -s xxx shell tpdtest'), shell=True, capture_output=True,universal_newlines=True)
#            print(cmdtask.stdout,file=f1)
#        print("\033[33m counter=",counter,"  tp: \033[0m ","adb -s xxx shell tpdtest=",cmdtask.stdout,"\033[36m phone_time=",get_phone_time(),"\033[0m")
        #    cmdtask= subprocess.run(' {}'.format("adb -s xxx shell enter_lpm.sh"), shell=True, capture_output=True,universal_newlines=True)
        #    #print(cmdtask.stdout,file=f1)
        #    print("\033[33m counter=",counter,"  lcd: \033[0m ","adb -s xxx shell enter_lpm.sh=",cmdtask.stdout)
        print("\033[33m the ",counter,"times, tp: \033[0m "," adb -s xxx shell tpdtest=",cmdtask.stdout)
'''文章来源地址https://www.toymoban.com/news/detail-840580.html

到了这里,关于手机多模块反复重启压力测试脚本的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【嵌入式】ESP32几个反复重启的bug记录

    最近在使用ESP32开发一些无线应用,在经历重重困难能够顺利编译-下载工程后,尝试把STM32中的程序移植到ESP32中,但由于对FreeRTOS系统了解不够深入,所以遇到了很多导致板子一直Rebooting的bug,在此记录一下。 在创建一个消息队列时需要给出队列长度,同时也需要相应的读取

    2023年04月08日
    浏览(41)
  • APP性能测试Monkey随机压力测试(android手机压测)

    App本身性能数据获取(cpu 内存 帧率 启动时间 流量 电量) Monkey随机压力测试(android手机压测) Android SDK,即Android Software Development Kit,是android的软件开发工具包. 它提供了在Windows/Linux/Mac平台上开发Android应用的开发组件。包含了在Android平台上开发移动应用程序的各种工具集。 使用

    2024年02月03日
    浏览(36)
  • 因磁盘空间不足导致MacBook Pro无法启动(反复重启)的解决过程

    我的电脑是2017版的15寸MacBook Pro,SSD空间512G,因为装了windows和Linux虚拟机,再加上微信、QQ都是吃磁盘大户,剩余空间仅剩11G左右。 最近启动一直很慢,昨天一早干脆反复启动,出现一个多语言版的提示:“电脑因出现问题而重新启动,请按一下按键,或等几秒钟以继续启动

    2024年02月15日
    浏览(49)
  • 【小白刷机】Pixel手机刷Magick模块不兼容重启卡开机logo解决方式

    Pixel作为一台谷歌手机,在国内不使用魔法是基本无法使用的,用了魔法也存在许多局限。正常人不在国内用Pixel,除非喜欢给自己找麻烦。但我实在想体验一下什么叫谷歌的软硬件一体化和原生安卓系统,踌躇许久终于入手了一台pixel4,结果大大超出预期,让我第一次感受到

    2024年02月10日
    浏览(30)
  • 问题记录:K8s中安装calico,calico反复重启,原因:版本未匹配

    K8s版本1.23.6 calico-node-反复重启,READY状态一直为0,STATUS为CrashLoopBackOff, 查看节点日志 没有错误,只有info信息 但是一直反复重启,导致coredns一直处于未准备好状态 calico与k8s的版本未匹配 删除calico,重新安装对应k8s版本 先删除calico pod 删掉calico.yaml文件 重新下载 k8s版本1.

    2024年02月09日
    浏览(32)
  • 软件测试工程师使用Jmeter工具做接口压力测试(Jmeter配置随机生成手机号)

    背景:性能测试的数据准备时很多情况需要产生一批新的数据,我们这次主要讲述的是如何产生随机的手机号,以用户注册接口为场景、生成随机手机号作为账号进行并发测试。 JMeter压力测试中设置线程组的线程数,即执行时的并发用户数,适用于单个线程组的并发测试。

    2023年04月19日
    浏览(60)
  • 掌动智能:替代JMeter的压力测试工具有哪些

    JMeter是一个广泛使用的开源压力测试工具,但在实际应用中,也有一些其他优秀的替代品可供选择。本文将介绍几个可替代JMeter的压力测试工具,它们在功能、性能和易用性方面都具有独特优势,可以满足不同压力测试需求的选择。 一、Gatling 功能强大:Gatling是一个基于Sc

    2024年02月07日
    浏览(38)
  • 模型评估:压力测试 模拟对手 对齐 智能对抗 CAPTCHA(全自动区分计算机和人类的公共图灵测试)

    如果认为对方是一个人就通过了图灵测试,真正的实现了智能。 如果智能达到了这种程度,智能体本身的CAPTCHA再也无法验证你是人还是机器了。有意思。 知道解锁,但这并不意味着你应该去撬锁。 CAPTCHA破解器(CAPTCHA breaker)指的是那些旨在自动解决CAPTCHA挑战的软件或系统

    2024年02月04日
    浏览(26)
  • Python+Pytest压力测试

    在现代Web应用程序中,性能是至关重要的。为了确保应用程序能够在高负载下正常运行,我们需要进行性能测试。 今天,应小伙伴的提问, 老向老师来写一个Pytest进行压力测试的简单案例。 这个案例的测试网站我们就隐藏了,不过网站的基本情况是: 阿里框架:FastAdmin.n

    2024年02月12日
    浏览(83)
  • python实现接口压力测试

    直接上代码: 输出20次压测结果如下:

    2024年02月17日
    浏览(32)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包