【发布时间】:2020-04-29 15:01:52
【问题描述】:
所以这就是我要找的。 每当我在 jmeter BeanShell 采样器中编写代码时,我总是会遇到编译时错误,并且我会花费大量时间来调试和修复它们。
那么有什么方法可以在运行之前编译它。
【问题讨论】:
标签: automation jmeter performance-testing load-testing beanshell
所以这就是我要找的。 每当我在 jmeter BeanShell 采样器中编写代码时,我总是会遇到编译时错误,并且我会花费大量时间来调试和修复它们。
那么有什么方法可以在运行之前编译它。
【问题讨论】:
标签: automation jmeter performance-testing load-testing beanshell
首先,您是否尝试过从 JMeter 安装的“lib”文件夹中运行 java -jar bsh-2.0b6.jar?它将启动Beanshell Desktop,您将能够在其中验证您的代码。
其次,它是interpreted,所以你不能编译它,如果你想要语法高亮和linting你可以考虑,即Beanshell editor plugin for Eclipse或BeanShell Box for Idea
第三,since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy 作为语言,是时候考虑迁移到 Groovy 了,因为它可以用任何现代 IDE 编译,而且 Groovy 的性能比 Beanshell 好得多。查看Apache Groovy - Why and How You Should Use It 文章了解更多详情。
【讨论】: