找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 5399|回复: 0

BeanShell 用法总结

[复制链接]

204

主题

64

回帖

876

积分

管理员

积分
876
发表于 2024-12-29 22:14:53 | 显示全部楼层 |阅读模式
一、什么是Bean Shell
  • BeanShell是一种完全符合Java语法规范的脚本语言,并且又拥有自己的一些语法和方法;
  • BeanShell是一种松散类型的脚本语言(这点和JS类似);
  • BeanShell是用Java写成的,一个小型的、免费的、可以下载的、嵌入式的Java源代码解释器,具有对象脚本语言特性,非常精简的解释器jar文件大小为175k。
  • BeanShell执行标准Java语句和表达式,另外包括一些脚本命令和语法。

二、Jmeter有哪些Bean Shell
  • 定时器:  BeanShell Timer
  • 前置处理器:BeanShell PreProcessor
  • 采样器:  BeanShell Sampler
  • 后置处理器:BeanShell PostProcessor
  • 断言:   BeanShell断言
  • 监听器:  BeanShell Listener

BeanShell与JMeter的关系JMeter提供5种方式使用BeanShell
  • BeanShell Sampler
    直接使用BeanShell来编写样例。
  • BeanShell  PreProcessor
    在样例触发前,使用BeanShell进行加工处理。
  • BeanShell  PostProcessor
    在样例触发后,使用BeanShell进行加工处理。
  • BeanShell  Assertion
    使用BeanShell进行断言处理。
  • BeanShell  Listener
    使用BeanShell做监听器。

BeanShell的内置对象对象名存在元素功能
logBeanShell Sampler
BeanShell PreProcessor
BeanShell PostProcessor
BeanShell Assertion
BeanShell Listener日志信息输出
LabelBeanShell Sampler样例
FileNameBeanShell Sampler文件名
ParametersBeanShell Sampler参数
bsh.argsBeanShell SamplerBeanShell脚本
SampleResultBeanShell Sampler
BeanShell Assertion
BeanShell Listener样例结果
ResponseCodeBeanShell Sampler
BeanShell Assertion返回的状态码
ResponseMessageBeanShell Sampler
BeanShell Assertion返回信息
IsSucessBeanShell Sampler是否成功
ctxBeanShell Sampler
BeanShell PreProcessor
BeanShell PostProcessor
BeanShell Assertion
BeanShell ListenerJMeter的上下文
varsBeanShell Sampler,BeanShell PreProcessor
BeanShell PostProcessor
BeanShell Assertion
BeanShell Listener变量操作
propsBeanShell Sampler
BeanShell PreProcessor
BeanShell PostProcessor
BeanShell Assertion
BeanShell ListenerJMeter属性
prevBeanShell PreProcessor
BeanShell PostProcessor
BeanShell Listener样例的前置结果读取
samplerBeanShell PreProcessor
BeanShell PostProcessor当前样例
ResponseBeanShell Assertion返回的对象,读-写
FailureBeanShell Assertion是否失败
FailureMessageBeanShell Assertion失败信息
ResponseDataBeanShell Assertion返回数据体,字节形式
ResponseHeaderBeanShell Assertion返回信息头
RequestHeaderBeanShell Assertion请求信息头
SampleLabelBeanShell Assertion样例名称
SampleDataBeanShell Assertion发送至服务器的数据
SampleEventBeanShell Listener读取当前样例的事件


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Android开发工具,脚本 ( 粤ICP备2024275843号 )

GMT+8, 2026-4-16 04:25 , Processed in 0.019803 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表