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

JMeter fails on beanshell imports

I had been using Beanshell pre-processor to add custom cookies created through javascript. While it used to work perfectly earlier, with the same line of codes I started to recieve errors in my pre-processor. ERROR -…
2
votes
1 answer

How to loop an HTTP request and update the variables each time in Jmeter BeanShell

I have 2 HTTP request: One to GET data from an api and the other to POST data to the api. The GET request brings several users in JSON. The POST request requires to 1 request per user. Hence I need to: Loop the same POST request several times…
Victor
  • 179
  • 2
  • 16
2
votes
2 answers

some Jmeter property substitution (${__P(...)}) not working in remote test

UPDATE: I attached the test script. The two substitutions not being honored are at CSV-DATASOURCE (the filename) and in the main thread group (number of threads): test plan file This is starting to drive us crazy. Using Jmeter 3.3 r1808647. Property…
2
votes
1 answer

Access to the jEdit variables from SuperAbbrevs template

I wonder if there is any way how to access jEdit variables (like the buffer variable) from the beanshell inside SuperAbbrevs plugin template. When I try to expand following template, the error Attempt to resolve method: getName() on undefined…
eNca
  • 1,043
  • 11
  • 21
2
votes
3 answers

Invoking Transaction controller or HTTP sampler from Bean shell/JSR223

Problem statement. Set of transactions(1000+) and need to call or reuse(without duplicating in different if/switch controllers) by invoking from the Beanshell or JSR233. In SoapUI we have groovy script option to break sequential execution and divert…
Load Stitch
  • 167
  • 2
  • 11
2
votes
2 answers

How to put value of User Defined Variable into Bean shell Sampler Variable - Jmeter

I try to move a User Defined variable to variable in beanshell sampler. (I need the User defined variable to be part of a bigger string.) When I try to move it, or make a copy of it I get error 500 can someone please advise how can I put the value…
Bastian
  • 1,089
  • 7
  • 25
  • 74
2
votes
2 answers

Put value in parameter using beanshell and jmeter

I have a question about a very basic script that I wrote, I just want to get data from DB, put it in a variable using beanshell sampler. and in the end of the thread group to create another bean shell and check the value of this variable. the…
Bastian
  • 1,089
  • 7
  • 25
  • 74
2
votes
1 answer

JMeter - Calling HTTP samplers in JSR223/BeanShell samplers

in SoapUI I had the ability to execute test steps and http requests using JavaScript to allow more dynamic tests. After facing some problems I moved to JMETER. After searching other questions and the Jmeter documentation, I can't find a way to call…
2
votes
1 answer

Stop JMeter test in Beanshell PreProcessor

I need a way to stop my main sample from being executed and also stop my test. I have read this post on stackoverflow but this does not prevent the main sample from being executed. JMeter - Stop Thread from within a BeanShell PreProcessor I have an…
Blacksoil
  • 29
  • 1
  • 4
2
votes
1 answer

JMeter - How to loop through "bsh.shared" ArrayList in a single Thread Group?

I have a BeanShell PostProcessor under the setUp Thread Group. I put the ArrayList into the "bsh.shared" namespace like: List personIdsList = new ArrayList(); ... bsh.shared.personIds = personIdsList; I know how to read the value via __BeanShell…
Yaryna
  • 340
  • 1
  • 5
  • 11
2
votes
1 answer

Lock contention in Java Beanshell interpreter under high load

We are using Java BeanShell interpreter (v1.2 b7) in our application for dynamically executing standard Java syntax. Sample Code bsh.Interpreter interpreter = new bsh.Interpreter(); interpreter.set("context", ctx); interpreter.set("transaction",…
Aman
  • 1,170
  • 3
  • 15
  • 29
2
votes
3 answers

How to execute java class in jar file from Jmeter

I am fresher in Jmeter I have created a two class as *package test; public class Urlmap { static String turl=null; public String display(){ String url="/xyz"; Test2 t=new Test2(url); turl=t.x; return "/xyz"; …
XillercoreX
  • 21
  • 1
  • 2
2
votes
3 answers

jmeter Beanshell - Error invoking bsh method: eval

I am trying to print 3 variables from 3 different HTTP requests in same Thread Group . I wrote following BeanShell in Jmeter: try { hash1 = vars.get("var_Hash_1"); hash2 = vars.get("var_Hash_2"); hash3 = vars.get("var_Hash_3"); …
Wojtas.Zet
  • 636
  • 2
  • 10
  • 30
2
votes
1 answer

How to set Encoding in MQ headers using Beanshell in Jmeter

I am developing a test script to put a message onto a queue using IBM MQ API 8.0. I am using JMeter 3.1 and Beanshell Sampler for this (see code below). The problem I am having is setting the "Encoding" field in the MQ headers. I've tried different…
Rico1971
  • 21
  • 1
2
votes
1 answer

How to increment variables in JMeter and how to override values of user defined variables?

I need to increment a variable for each thread. Example: Thread 1: $(Test_Var) should be 1001 Thread 2: $(Test_Var) should be 1002 Thread 3: $(Test_Var)) should be 1003 and so on .. In the test plan I defined some user defined variables. Here I…