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

oracle thin driver which jar file is used?

I have inherited a VM (linux OS) from someone. It has a java app "bob" deployed/running inside of tomcat and oracle 11.2.0 database. I wrote a simple db connection in beanshell (lightweight of java) as following example and it executed fine however…
DaeYoung
  • 1,161
  • 6
  • 27
  • 59
2
votes
2 answers

How to save Jmeter Variables to csv file

Does anyone knoe how to save specific Jmeter Variables into a csv file? I have already tried this topic with no succes: Write extracted data to a file using jmeter and this code: FileWriter fstream = new FileWriter("result.csv",true); BufferedWriter…
Roxana
  • 33
  • 1
  • 1
  • 6
2
votes
1 answer

How do I override the response content in a JMeter WebDriver sampler test?

How do I override the response content in a JMeter WebDriver sampler test? When I run the following code, the response that is shown in the response tab of the WebDriver Sampler is the full content of the webpage rather than what I expected to see,…
djangofan
  • 28,471
  • 61
  • 196
  • 289
2
votes
3 answers

BeanShell Post Processor parse Json using Jmeter

I need to test rest api posting Json. I try to post Json Data by BeanShell PostProcessor using Jmeter. But BeanShell PostProcessor doesn't work or I couldn't write the right code. My Json is : {"email":"selin@xxx.com","password":"123"} You can see…
cell-in
  • 709
  • 2
  • 11
  • 27
2
votes
2 answers

evaluating a string of code in beanshell and getting the value being returned by the beanshell interpreter

I am working with beanshell bsh-2.0b4.jar file. I have build path and used it in a java program. I have managed to get the get the print statements from the console. But if a value is being returned, how to get the return value. import…
user3371303
  • 43
  • 1
  • 4
2
votes
1 answer

Symmetricds change source base dir for file sync dynamically

We have a corp node and many store nodes for file sync. We have sync files from each store nodes to corp node. The source directory be different in different stores. Can we change the base dir of a file trigger dynamic using something like bean…
2
votes
3 answers

How do I obtain the Android context in BeanShell for SL4A?

I started exploring BeanShell for SL4A because I read that it could access the entire Android API. This would facilitate experimenting with API features and programming ideas without the need for a computer or compilation. However, much of the API…
James Haigh
  • 1,192
  • 1
  • 12
  • 25
2
votes
1 answer

How to put an ArrayList object to the props variable of jmeter and use it from Beanshell script

I am trying to do this from a beanshell sampler. import java.util.List; import java.util.ArrayList; list = new ArrayList(); props.putObject("list", list ); Now from another Beahshell sampler I want to do this. list =…
Rajan
  • 1,501
  • 4
  • 21
  • 37
2
votes
1 answer

Passing JMeter user variable across beanshell script in different threads

What I'm trying to do is pass variable between the threads in JMeter - so one thread modify this value and next one will get it - please look at this structure: Test Plan User Defined Variables Thread Group 1 BSF PreProcessor …
pbaranski
  • 22,778
  • 19
  • 100
  • 117
2
votes
1 answer

Call a java method with JMeter

My problem is about JMeter and the BeanShell PostProcessor. I have developped a Java project with Eclipse and exported that project in a jar. I have put this jar in /lib/ext folder of JMeter. When I call java -jar C:\Program…
northix
  • 65
  • 1
  • 2
  • 8
2
votes
1 answer

How to stop jmeter during runtime based on coditions?

I wanted to stop jmeter if my conditional logic is false,suppose if one of my conditions gets failed then i need to stop immediately all my threads(jmeter) during run time,so that is there any way stop it running time through code not manually(not…
AutomationWorld
  • 75
  • 2
  • 10
2
votes
1 answer

Beanshell script to use data from CSV

I have dynamically created parameters using regular expression extractor and beanshell script (given below). I am creating parameters with Name = "pass_" + i. Now I need to populate the value of these parameter field from a CSV file. I have loaded a…
user2131458
  • 31
  • 2
  • 6
2
votes
1 answer

How to create a load splitting scenario? in JMeter

Currently i'm working on load splitting scenario in jmeter. My test-plan structure is similar as below: TestPlan BeanShell Preprocessor (here I have below code) Integer totalLoad = 0; Integer searchUsers = 0; Integer createUseres = 0;…
user1767083
  • 157
  • 1
  • 3
  • 10
2
votes
1 answer

JMeter BeanShell Listener All Results

I'm writing a BeanShell script in JMeter to process the results of the HTTP Requests. I'm able to use the Post-processor to capture these results and process individually however it means adding a Post-processor to every Request. Is it possible in…
Paddy
  • 523
  • 1
  • 6
  • 29
2
votes
2 answers

exec() in BeanShell macro causes jEdit to hang when it returns non-zero exit code

I have a jEdit BeanShell macro that runs my Markdown files through Maruku when I save them: if (buffer.getMode().toString().equals("markdown")) { cmd = "C:\\Ruby\\bin\\maruku.bat -o " + buffer.getDirectory() +…
rossmeissl
  • 153
  • 2
  • 6