当前位置:网站首页>Learn BeanShell before you dare to say you know JMeter
Learn BeanShell before you dare to say you know JMeter
2022-07-02 04:40:00 【Peng Yuyan in the testing industry】
jmeter Of BeanShell Sampler, You can quote java Code , There are the following 3 Ways of planting :
Direct input java Code
Import java file
Import class file
BeanShell Script accesses variables mainly through vars and props To visit , Common main methods are as follows :
vars.get( Variable name ): Get the value corresponding to the defined variable , contain BeanShell Script generation variables ;
vars.put( Variable name , A variable's value ): Generate new variables or modify existing variables ;
props.get( Variable name ): obtain jmeter.properties Define the corresponding value of the variable in ;
01、 Direct input Java Code
1、 stay testplan Add variable value to

add to BeanShell Sampler, Pay attention to BeanShell One must be added before and after Debug Sampler, It should be convenient for debugging to see the result , Added Debug Sampler No need for any operation .

Run to view the execution results

2、 stay jmeter Call method used in

View results

02、BeanShell Introduction in Java file
Write a Java Save the file to the desktop

stay BeanShell Introduce the Java file

View the results of the execution

03、BeanShell Introduction in class file

View the generated results

04、BeanShell Realize encryption and decryption
1、 stay IDEA Write the encrypted script in

2、 Then export the entire package file , Generate jar package

3、 take jar Put the package file in jmeter Of lib/ext Under the table of contents

And then in jmeter Of BeanShell This class is introduced in , Call the encryption method

View debugging results


Save the encrypted data to mdm In this variable , For jmeter Use in .
The following is the supporting information , For doing 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you !
Last : It can be in the official account : Programmer Xiaohao ! Get a free copy of 216 Page software testing engineer interview guide document information . And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .
If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One button, three links ! Friends who like software testing , You can join our testing technology exchange group :779450660 There are various software testing resources and technical discussions )
边栏推荐
- 记录一次Unity 2020.3.31f1的bug
- 初学爬虫-笔趣阁爬虫
- 万卷共知,一书一页总关情,TVP读书会带你突围阅读迷障!
- Unit testing classic three questions: what, why, and how?
- geotrust ov多域名ssl證書一年兩千一百元包含幾個域名?
- Wechat applet pull-down loading more waterfall flow loading
- WiFi 5GHz frequency
- 第十六周作业
- Gin framework learning code
- Landing guide for "prohibit using select * as query field list"
猜你喜欢

Several methods of capturing packets under CS framework

DMA Porter

【c语言】动态规划---入门到起立

Deep understanding of lambda expressions

Yolov5 network modification tutorial (modify the backbone to efficientnet, mobilenet3, regnet, etc.)

My first experience of shadowless cloud computer

CY7C68013A之keil编译代码

UNET deployment based on deepstream

CorelDRAW graphics suite2022 free graphic design software

Ten thousand volumes are known to all, and one page of a book is always relevant. TVP reading club will take you through the reading puzzle!
随机推荐
Summary of main account information of zhengdaliu 4
Common errors of dmrman offline backup
Idea automatic package import and automatic package deletion settings
Detailed process of DC-1 range construction and penetration practice (DC range Series)
Introduction to JSON usage scenarios and precautions
Homework of the 16th week
The core idea of performance optimization, dry goods sharing
June book news | 9 new books are listed, with a strong lineup and eyes closed!
DMA Porter
Play with concurrency: what's the use of interruptedexception?
Shutdown procedure after 60
One step implementation of yolox helmet detection (combined with oak intelligent depth camera)
Wechat applet JWT login issue token
One click generation and conversion of markdown directory to word format
Let正版短信测压开源源码
C language practice - number guessing game
Wechat applet calculates the distance between the two places
Geotrust OV Multi - Domain Domain SSL Certificate rmb2100 per year contains several Domain names?
ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification
【提高课】ST表解决区间最值问题【2】