Questions tagged [beanshell]

Lightweight scripting for Java

From the official site:

BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. BeanShell dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript

943 questions
4
votes
5 answers

Can I strictly evaluate a boolean expression stored as a string in Java?

I would like to be able to evaluate an boolean expression stored as a string, like the following: "hello" == "goodbye" && 100 < 101 I know that there are tons of questions like this on SO already, but I'm asking this one because I've tried the most…
DLaw
  • 821
  • 2
  • 9
  • 16
4
votes
1 answer

JMeter setProperty depending on ResponseCode or String value

I am writing a test where different users have different rights to add and delete other users to a team. The test checks if the user can add a new user to the team or delete an existing user from the team. However the users who can't add a new user…
Yves Mertens
  • 181
  • 1
  • 4
  • 11
4
votes
2 answers

How can I add delay between thread groups in Jmeter?

There are 7 thread groups in our test plan: Thread group 1 Thread group 2 Thread group 3 Thread group 4 Thread group 5 Thread group 6 Thread group 7 When thread group 1 finishes, I need to add a delay before thread group 2 starts. I have thought…
4
votes
2 answers

Executing shell commands through beanshell in jmeter

Executing shell commands through beanshell in jmeter. I want to execute shell commands in beanshell preprocessor in jmeter Can any one tell how to do so.
user1788294
  • 1,823
  • 4
  • 24
  • 30
4
votes
3 answers

JMeter - Run a python script before calling each HTTP request sampler

I am new to Jmeter. My HTTP request sampler call looks like this Path= /image/**image_id**/list/ Header = "Key" : "Key_Value" Key value is generated by calling a python script which uses the image_id to generate a unique key. Before each sampler I…
user1788294
  • 1,823
  • 4
  • 24
  • 30
4
votes
2 answers

Beanshell catch(ex): Exception or Throwable?

What type of exception is caught by the beanshell catch(ex): Exception or Throwable?. Example: try { .... } catch (ex) { }
Antonio
4
votes
2 answers

Beanshell - using arraylist

I am using beanshell and i want to use arraylist My code - import java.util.*; List test= new ArrayList(); test.add("Last Name"); But I am getting following exception Caused by: org.apache.bsf.BSFException: BeanShell script error:Typed variable…
Coder
  • 3,090
  • 8
  • 49
  • 85
3
votes
2 answers

JMeter - Execute command over telnet using beanshell

I'm trying to write a jmeter sampler in beanshell to execute a memcached telnet interface command, specifically flush_all. I need this to clear the cache after each test as it causes tests in quick succession to fail. I have the following…
Adrian
  • 143
  • 1
  • 4
  • 13
3
votes
1 answer

Beanshell will not allow me to add jars to the "default" JRE classloader?

I have a question about Beanshell that I can't find an answer to anywhere. I am only able to run Beanshell scripts in 1 of 2 ways: Where Classpath is defined before invoking Beanshell and Beanshell uses the JRE default classloader. Where no…
djangofan
  • 28,471
  • 61
  • 196
  • 289
3
votes
3 answers

Choosing scripting language

I'm trying to choose between groovy and beanshell, I need one that is in active development, is moderately fast, can access/interpret java code and support restriction to which java classes it can access in my internal code. I'm not sure if…
John
  • 41
  • 2
3
votes
1 answer

Looking for BeanShell Validator plugin for Eclipse

I have inherited a Java WebApp that contains the majority of its business logic in a 16K line BeanShell File. I am looking for something that will validate my BeanShell files so I know at least it is working as it should, if I could debug the script…
PseudoNinja
  • 2,846
  • 1
  • 27
  • 37
3
votes
1 answer

JMeter external JSR223 java edited in Intellij

I'd like to reach that point where I have a development environment with the following attributes: JMeter tests consist of JSR 233 scripts mainly JSR 233 scripts are written in Java I can edit the java code in IntelliJ the project is a maven…
AndrasCsanyi
  • 3,943
  • 8
  • 45
  • 77
3
votes
2 answers

Looking for: IntelliJ IDEA plugin with BeanShell syntax support

I was wondering if there is a plugin to support the BeanShell scripting framework in IntelliJ IDEA? Setting the *.bsh file type as a Java source causes all sort of bad syntax warnings.
Florin
  • 528
  • 5
  • 14
3
votes
1 answer

Comparing two values in JMeter with JSR223 Assertion

I have the following scenario: HTTP Request Sampler - RegEx Extractor - JSR223 Assertion The Regex Extractor scrapes for a tag the response. I need to compare that the number of total elements in the array is less than 20k. Here are the actuals…
Paramjit Kaur
  • 33
  • 1
  • 3
3
votes
2 answers

No signature of method: org.apache.jmeter.threads.JMeterVariables.put() is applicable for argument types: (java.lang.String, java.lang.Integer)

I have a Sample JSON response as below: { "id": 37, "merchant_id": "39", "title": "Parker Pens", "subtitle": null, "price": 1000, "description": null, "images": [], "image_thumbs": [], "options": [{ "code": "color", "label": "Color", …
Siddish
  • 97
  • 3
  • 12