当前位置:网站首页>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 )
边栏推荐
- LeetCode-归并排序链表
- Markdown编辑语法
- Promise all()
- 二叉树解题(一)
- CorelDRAW Graphics Suite2022免费图形设计软件
- Mysql表insert中文变?号的问题解决办法
- FAQ | FAQ for building applications for large screen devices
- Wechat applet pull-down loading more waterfall flow loading
- What data does the main account of Zhengda Meiou 4 pay attention to?
- Dare to go out for an interview without learning some distributed technology?
猜你喜欢
Mapping location after kotlin confusion
Record the bug of unity 2020.3.31f1 once
How to write a client-side technical solution
Social media search engine optimization and its importance
Keil compilation code of CY7C68013A
Mysql表insert中文变?号的问题解决办法
idea自動導包和自動删包設置
Cannot activate CONDA virtual environment in vscode
[C language] basic learning notes
Unity particle Foundation
随机推荐
Introduction to Luogu 3 [circular structure] problem list solution
缓存一致性解决方案——改数据时如何保证缓存和数据库中数据的一致性
Wechat applet map annotation
cookie、session、tooken
正大美欧4的主账户关注什么数据?
Arbre binaire pour résoudre le problème (2)
Shutdown procedure after 60
LeetCode-归并排序链表
Pytorch---使用Pytorch实现U-Net进行语义分割
记录一次Unity 2020.3.31f1的bug
Landing guide for "prohibit using select * as query field list"
第十六周作业
My first experience of shadowless cloud computer
Playing with concurrency: what are the ways of communication between threads?
One click generation and conversion of markdown directory to word format
C language guessing numbers game
Solution of DM database unable to open graphical interface
win11安装pytorch-gpu遇到的坑
Pytoch --- use pytoch for image positioning
Thinkphp內核工單系統源碼商業開源版 多用戶+多客服+短信+郵件通知