当前位置:网站首页>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: divisible number inclusion exclusion principle
- [data mining] task 4:20newsgroups clustering
- [technology development-23]: application of DSP in future converged networks
- 音程的知识的总结
- Network security - the simplest virus
- 云原生题目整理(待更新)
- 【数据挖掘】任务2:医学数据库MIMIC-III数据处理
- 串口抓包/截断工具的安装及使用详解
- [data mining] task 5: k-means/dbscan clustering: double square
- Sweet talk generator, regular greeting email machine... Open source programmers pay too much for this Valentine's day
猜你喜欢

C application interface development foundation - form control (2) - MDI form

What is tone. Diao's story

One of the C language practical projects is greedy snake

¢ growth path and experience sharing of getting an offer

7-25 read numbers (loop switch)
![[shutter] animation animation (basic process of shutter animation | create animation controller | create animation | set value listener | set state listener | use animation values in layout | animatio](/img/70/54eb9359ac91aa43383b240eb036b7.gif)
[shutter] animation animation (basic process of shutter animation | create animation controller | create animation | set value listener | set state listener | use animation values in layout | animatio

【数据挖掘】任务2:医学数据库MIMIC-III数据处理

High resolution network (Part 1): Principle Analysis

CF1617B Madoka and the Elegant Gift、CF1654C Alice and the Cake、 CF1696C Fishingprince Plays With Arr

自定义组件、使用npm包、全局数据共享、分包
随机推荐
【数据挖掘】任务5:K-means/DBSCAN聚类:双层正方形
C application interface development foundation - form control (2) - MDI form
STM32 - Application of external interrupt induction lamp
[shutter] animation animation (the core class of shutter animation | animation | curvedanimation | animationcontroller | tween)
After reading this article, I will teach you to play with the penetration test target vulnhub - drivetingblues-9
[data mining] task 5: k-means/dbscan clustering: double square
查询商品案例-页面渲染数据
【Camera专题】HAL层-addChannel和startChannel简析
Caused by: com. fasterxml. jackson. databind. exc.MismatchedInputException: Cannot construct instance o
7-25 read numbers (loop switch)
STM32 - vibration sensor control relay on
网络安全-钓鱼
QTableWidget懒加载剩内存,不卡!
[QT] encapsulation of custom controls
Custom components, using NPM packages, global data sharing, subcontracting
网络安全-病毒
What is tone. Diao's story
Why can't the start method be called repeatedly? But the run method can?
Rockchip3399 start auto load driver
C#应用程序界面开发基础——窗体控制(2)——MDI窗体
