当前位置:网站首页>Learn BeanShell before you dare to say you know JMeter
Learn BeanShell before you dare to say you know JMeter
2022-07-03 01:47:00 【Software testing Jun】

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 technology industry should continue to learn , Don't fight alone in your study , It's best to keep warm , Achieve each other and grow together , The effect of mass effect is very powerful , Let's learn together , Punch in together , Will be more motivated to learn , And you can stick to it . You can join our testing technology exchange group :914172719( There are various software testing resources and technical discussions )
Here's a message for you , Mutual encouragement : When our abilities are insufficient , The first thing to do is internal practice ! When we are strong enough , You can look outside !

Finally, we also prepared a supporting learning resource for you , You can scan the QR code below via wechat , Get one for free 216 Page software testing engineer interview guide document information . And the corresponding video learning tutorial is free to share !, The information 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. .
Friends who like software testing , If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One button, three links !
Good article recommends
Interview : First tier cities move bricks ! Another software testing post ,5000 That's enough …
What kind of person is suitable for software testing ?
The man who leaves work on time , Promoted before me …
The test post changes jobs repeatedly , Jump, jump and disappear …
“ One year in the job , The automated software test hired by high salary was discouraged .”

边栏推荐
- 音程的知识的总结
- Mathematical knowledge: Nim game game theory
- STM32 - Application of external interrupt induction lamp
- Certaines fonctionnalités du développement d'applets
- Introduction to flask tutorial
- leetcode刷题_两数之和 II - 输入有序数组
- [error record] the shutter component reports an error (no directionality widget found. | richtext widgets require a directionality)
- Custom components, using NPM packages, global data sharing, subcontracting
- Summary of interval knowledge
- Virtual list
猜你喜欢

音程的知识的总结

Steps to obtain SSL certificate private key private key file
![[data mining] task 5: k-means/dbscan clustering: double square](/img/e7/678197e703d1a28b765a0e3afd5580.png)
[data mining] task 5: k-means/dbscan clustering: double square

Smart management of Green Cities: Digital twin underground integrated pipe gallery platform

查询商品案例-页面渲染数据

LeetCode 987. Vertical order transverse of a binary tree - Binary Tree Series Question 7

Network security - vulnerabilities and Trojans

View of MySQL
![[data mining] task 6: DBSCAN clustering](/img/af/ad7aa523b09884eee967c6773a613f.png)
[data mining] task 6: DBSCAN clustering

Force buckle 204 Count prime
随机推荐
【数据挖掘】任务5:K-means/DBSCAN聚类:双层正方形
Telecom Customer Churn Prediction challenge
网络安全-钓鱼
传输层 TCP主要特点和TCP连接
Types of map key and object key
Network security - Trojan horse
C application interface development foundation - form control (2) - MDI form
word插入公式/endnote
[data mining] task 1: distance calculation
[interview question] 1369 when can't I use arrow function?
[keil5 debugging] debug is stuck in reset_ Handler solution
Wordinsert formula /endnote
[untitled]
【数据挖掘】任务4:20Newsgroups聚类
¢ growth path and experience sharing of getting an offer
Main features of transport layer TCP and TCP connection
Force buckle 204 Count prime
GDB 在嵌入式中的相关概念
Huakaiyun | virtual host: IP, subnet mask, gateway, default gateway
Cloud native topic sorting (to be updated)
