【问题标题】:How to compile the BeanShell sampler in jmeter, before runnig it如何在运行之前在 jmeter 中编译 BeanShell 采样器
【发布时间】:2020-04-29 15:01:52
【问题描述】:

所以这就是我要找的。 每当我在 jmeter BeanShell 采样器中编写代码时,我总是会遇到编译时错误,并且我会花费大量时间来调试和修复它们。

那么有什么方法可以在运行之前编译它。

【问题讨论】:

    标签: automation jmeter performance-testing load-testing beanshell


    【解决方案1】:

    首先,您是否尝试过从 JMeter 安装的“lib”文件夹中运行 java -jar bsh-2.0b6.jar?它将启动Beanshell Desktop,您将能够在其中验证您的代码。

    其次,它是interpreted,所以你不能编译它,如果你想要语法高亮和linting你可以考虑,即Beanshell editor plugin for EclipseBeanShell 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 文章了解更多详情。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多