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

859 questions
55
votes
9 answers

How do I pass a variable from one Thread Group to another in JMeter

I have a JMeter test with 2 Thread Groups - the first is a single thread (which creates some inventory) and the second has multiple threads (which purchase all the inventory). I use BeanShell Assertions and XPath Extractors to parse the returned…
Todd R
  • 17,208
  • 8
  • 27
  • 35
21
votes
4 answers

Jmeter. BeanShell PostProcessor

I have gone through the bean shell scripting in jmeter but i did not find any example of that, how it is useful in jmeter and which way.means reading the sampler values etc. Can any one explain bean shell scripting in Jmeter with…
zeus.atr
  • 227
  • 1
  • 2
  • 5
12
votes
3 answers

JMeter use beanshell variable in HTTP Request

I'm an absolute rookie here (JAVA i mean), spent hours looking for a solution, now i just want to shoot myself. I want to create a string in the beanshell assertion which is placed right above the HTTP Request. In the beanshell i wrote: String…
Suyash
  • 625
  • 1
  • 5
  • 22
11
votes
3 answers

JMeter / Beanshell "Error invoking bsh method: eval Sourced file:"

I'm having an issue in JMeter wherein I receive this error 2014/08/14 14:13:26 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String RequestUrl = vars.get("RequestUrl"); String[]…
sidd
  • 115
  • 1
  • 1
  • 6
10
votes
1 answer

Java with Beanshell to access fields and object with clean code

1). I know how to access the java fields and object in beanshell from my question Use java class fields in beanshell. However, it is not so clean way to implement as I need to first set the java variable in beanshell and then I can use it. However,…
Karim Narsindani
  • 364
  • 3
  • 11
  • 32
10
votes
1 answer

How do I generate a timestamp and put it in a variable in jmeter?

How do I generate a timestamp and put it in a variable in jmeter? So that the variable can be passed in the URL.
Nikhil
  • 333
  • 1
  • 5
  • 19
10
votes
3 answers

How to integrate beanshell

I am developing a component based game engine in java, right now when i have changes to the components I need to rebuild and restart the editor for the changes to take effect (or i can use some limited hot code injection if the application is…
Anton Banchev
  • 535
  • 6
  • 25
9
votes
2 answers

define a list in BeanShell (jmeter)

Could anyone help with BeanShell script? So, I'm trying to use a List in my code sample, however, I couldn't define a list properly. The code like this from BeanShell PostProcessor sampler: import java.io.*; import java.util.*; import…
Leo
  • 583
  • 2
  • 7
  • 20
9
votes
4 answers

Beanshell in Ant yielding, "Unable to create javax script engine for beanshell"

Greeting, I'm trying to put some Beanshell script in my Ant build.xml file. I've followed the Ant manual as well as I can but I keep getting "Unable to create javax script engine for beanshell" when I run Ant. Here is the test target I wrote…
Vimes
  • 7,886
  • 14
  • 52
  • 83
7
votes
1 answer

How to get value from property in BeanShell (jmeter)

I have got several thread groups. I want to use variable from the first group. In second group this var should be used in BeanShell. So: in first thread group I created BeanShell Assertion with this code: ${__setProperty(erroriden,…
Ololowa QA
  • 85
  • 1
  • 1
  • 6
6
votes
3 answers

Should I use Jython, JRuby, Beanshell, Groovy, Rhino, or what for this small task?

I have some batch data-manipulation scripts which support a small business website. The scripts are a "rat's nest" of Perl, Java, and Stored Procedures, which run on a scheduled basis to update data based on various sources and algorithms. I want to…
Alex R
  • 10,320
  • 12
  • 76
  • 145
6
votes
1 answer

How to get the complete log for bean shell scripts in jmeter

I am using Apache JMeter 3.1 and in my test suite I have a BeanShell PreProcessor. When I run the scrip, in the Log Viewer I can see there are errors in the bean shell script. But the error message is very limited, how can I get the complete…
6
votes
1 answer

JMeter - Static method get( java.lang.String ) not found in class'java.nio.file.Paths'

I am trying to create a JMeter load test. I need the test to take a sample log file and change its name. The only way I could find to do this was to copy the file in a BeanShell Preprocessor but I am getting the following error: ERROR -…
Grimx34
  • 63
  • 1
  • 6
6
votes
1 answer

JSON web token generator for JMeter

I'm trying to compare JWT value returned by an API call to an expected valid value in JMeter. For this, I need to generate the expected value in a pre-processor (either the BSF pre-processor or the Bean shell pre-processor) and then compare it to…
Iryna
  • 93
  • 1
  • 8
6
votes
1 answer

JMeter | How to define variables such that their scope is in {thread, Thread-Group, Test-Plan} from within BeanShell

I am trying to write a test plan, where a custom report is generated based on the text on the samplers. I could not scope the variables correctly in these three levels. loc = vars.get("local_count"); if(loc == null){ vars.put("local_count",…
Rajan
  • 1,343
  • 3
  • 19
  • 31
1
2 3
57 58