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
5
votes
1 answer

how to make methods in beanshell?

I made a simple beanshell ide in android using an edittext and a button. When the button is clicked, Interpreter.eval() is called and edittext.getText().toString() is passed in as the parameter. I want to know: how can I make a method in beanshell…
awareeye
  • 2,831
  • 3
  • 19
  • 22
5
votes
3 answers

Is there an alternative to BeanShell ? Something like javascript or groovy console for Java?

I was wondering if there is some kind of shell that would just listen to user input (with a line buffer) and run in internally from within main method, including jdk on classpath. So that it would look like JavaScript console in browsers or groovy…
lisak
  • 20,109
  • 39
  • 146
  • 236
5
votes
4 answers

How do i remove empty parameter using beanshell preprocessor in jmeter

I am trying to read a csv file that contains more that 500+ rows and each row will serve as request to API. Now my problem is that some of the parameters have empty string and i would like to set up a condition in case if parameter returns empty…
Jon Abraham
  • 641
  • 2
  • 8
  • 18
5
votes
3 answers

How to get Machine IP Address using beanshell in JMeter?

I am trying to write a script in beanshell for jmeter through which I can get the IP address of a machine (using ipconfig command and extract only IP Address from the output)? The following code is giving only the IP of the request of which needs to…
Nikhil
  • 333
  • 1
  • 5
  • 19
5
votes
4 answers

Want to script a C# application

I need to run some validation tests on our c# client-server configuration. Is there a dynamic script language that my client application could run, that would have full access to all of its C# classes and asssemblies? Something like beanshell for…
Jacko
  • 11,326
  • 15
  • 66
  • 112
5
votes
1 answer

JMeter - Stop Thread from within a BeanShell PreProcessor

Is it possible to stop a Thread, or force a failure from within a BeanShell PreProcessor? I tried accessing the "stop()" function/method from the ThreadGroup Class and a few others, but I'm not sure I'm doing it right or if its possible. I wanted to…
Matt
  • 393
  • 6
  • 15
5
votes
2 answers

Use of Beanshell Preprocessor for Parameterization in JMeter

I am trying to use beanshell preprocessor for parameterization in JMeter script.My JMeter script structure is as mentioned below. Test plan->Thread group->Transaction Controller->Requests.I want to know which procedure I should follow to dynamically…
5
votes
1 answer

Parsing string to integer in BeanShell Sampler in JMeter

I'm trying to parse a string into integer in JMeter but failed due to following error. If I try to print the strings returned by vars.get, they look good. 2014/06/28 00:08:52 WARN - jmeter.assertions.BeanShellAssertion:…
TechCrunch
  • 2,356
  • 3
  • 39
  • 73
5
votes
1 answer

Jython variable to Java Beanshell in ODI

I have the variable total_lines on a jython command that I needs to be accessed on the refreshing command of a ODI variable. with open('file.txt') as file_name: for total_lines, line in enumerate(file_name): pass print…
Afonso
  • 407
  • 1
  • 5
  • 16
4
votes
1 answer

How to use or escape java 8 Lambda expressions in Beanshell

I'm working on a Product (Sailpoint IdentityIQ that runs in Tomcat) which uses Beanshell env for product customization hooks. I want to write some code to parse a large csv file and want to leverage Java 8 Streams. But I'm facing issue with…
Madhu K
  • 43
  • 2
4
votes
1 answer

Great difference in Time Execution Groovy vs Beanshell

I'm interpreting a same script in both Groovy and Beanshell. Groovy takes a very long time(26 mins 25 secs), while Beanshell takes only 20 secs. I'm very astonished by the difference and I don't understand why, Is Beanshell is better? Am I using…
Mehdi Bouzidi
  • 1,783
  • 3
  • 12
  • 27
4
votes
4 answers

Jmeter: How to reuse custom java function between different JMX file

Requirement: Post response time of every sampler to Mongo DB, for that created an HttpClient java code(Class function). Problem: Need to call the custom (reuse same code between 150+ jmx file) Java function to be called from Beanshell after every…
Load Stitch
  • 157
  • 1
  • 9
4
votes
4 answers

S3 Access in a JMeter script

I'm trying to get a file from an S3 bucket as part of the Setup Thread Group for a JMeter test, and I have the following Groovy script in a JSR223 Sampler: import java.io.IOException import java.io.InputStream import java.util.Properties import…
user901616
4
votes
1 answer

How to generate random number using beanshell post processor in JMeter

I am trying to generate a random number using beanshell post processor but I am continuously getting an error "ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of: `` try {....." I am fetching the…
Naseem
  • 753
  • 2
  • 15
  • 41
4
votes
1 answer

is it possible to use jmeter to test grpc

Was wondering if anybody has tried to use jmeter to test gRPC application. I was hoping that I could write a gRPC client class with a non-blocking/asynchronous stub that makes non-blocking calls to the server, Create a Jar of the above client…
Alok A
  • 173
  • 2
  • 8
1
2
3
57 58