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
1
vote
2 answers

How to catch exception in a beanshell?

I can use the evaluateBeanshell rule to enforce some convention: no colon's in directories below src. maven-enforcer-plugin 1.4.1
caduceus
  • 1,542
  • 2
  • 16
  • 21
1
vote
1 answer

Download dynamic images concurrently

I need to download images concurrently.All the image url's have been extracted from one of the request's response.I used regular expression extractor to capture all the image urls.And ProfileImagePath_matchNr…
Svp57
  • 308
  • 2
  • 13
1
vote
1 answer

Why my JSON values are getting duplicated in Jmeter?

Here is my BeanShell script which I wrote in JMeter import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; JSONObject outerObject = new JSONObject(); JSONArray jsonArray = new JSONArray(); for(int i = 0;i<=3;i++) { …
Naseem
  • 911
  • 5
  • 18
  • 48
1
vote
1 answer

Jmeter: BeanshellAssertion Error: Method Not Found In Class

I simply want to read response from jdbc sampler and use it in an http request. I created a BeanShellAssertion Script under a jdbc request and wrote just the below code, nothing else. if(vars.getObjects("jdbcresult1").size!=0) { String…
1
vote
1 answer

Maven Enforcer: How to access maven properties from beanshell rule

I successfully created a evaluateBeanshell rule with the maven-enforcer-plugin that scans files in the workspace for common mistakes. With a hardcoded path the rule works fine. When I want to use the ${project.basedir} variable from the surrounding…
Ansgar
  • 1,747
  • 4
  • 17
  • 27
1
vote
0 answers

error on running testng gropus with beanshell through maven command

I have a setup like below. while running the tests with the -Dgroups, i get the below error. what is wrong with my setup? I need to pass which test groups to be run through my maven command. Any help on this is much appreciable. testng.xml
mmar
  • 1,840
  • 6
  • 28
  • 41
1
vote
2 answers

Add my own jar to jmeter lib directory without maven groupId and artifactId

I hava some Java code, this is going to be used in Bean Shell. The Java code I have already exported from IDEA and generated to a jar file, so it does not hava maven groupId. How can I add this jar file to the jmeter/lib directory? Here is the…
Mr.LiuDC
  • 109
  • 1
  • 3
  • 13
1
vote
1 answer

Not able to generate the client token or auth bearer token used in payment sandbox braintree request

How to generate the auth bearer token ,that going to be use in Performance tests script. I need to pass the dynamic value of token in the response header of payment.sandbox, braintree graphql request. But I am no where getting the value of…
1
vote
1 answer

How to capture output from Beanshell

I've been using BeanShell to interpret simple files that just do some calculations and then output to the console. Thing is, I want to grab the output. Such that from System.out.println("test"); I can get "test" as a string to put somewhere…
Infiniti Fizz
  • 1,726
  • 4
  • 24
  • 40
1
vote
1 answer

How can I load public key with Java in Jmeter?

I am trying to generate a JWT token in Jmeter. To "automate" it I have written a java class that contains a method that generates the token. In IntelliJ it works all fine and I receive a token. Therefore I've build a jar file and included it in…
bohunn
  • 79
  • 1
  • 7
1
vote
1 answer

How to create response assertion in beanshell at jmeter

There may be mistranslations because i'm using a translator. i want to create response assertion in beanshell script content is postrequest site and get responsedata but this request usually fail so i want to check everytime with response…
박성민
  • 11
  • 1
1
vote
2 answers

How to send multiple JSON in single request(Jmeter)

Though I could see this question might be repeated but couldn't find any similar solution for the below JSON strut. Pls suggest. I have excel sheet where the data's in columns look like : CSV file data My expected JSON as: { "Child…
Harmya
  • 41
  • 8
1
vote
0 answers

Build json payload in Jmeter using Jsr223 pre/post processer

Currently need to create json payload as post in jmeter using jsr223 pre/post Below is the response : { "list": [ { "listId": "003566", "position": "position01", "orderNo": "342455", "listTime": "91258", …
1
vote
1 answer

Beanshell values not random for thread

I've got a problem with trying to randomize some values. In this case I'm using Random to select a title from a string list. import java.util.Random; titles = "Mr,Mrs,Sir,Ms,Dr"; String[] titles = titles.split(","); Random random = new…
ratsstack
  • 1,012
  • 4
  • 13
  • 32
1
vote
2 answers

JMeter : How to increment +1 hour 24 times and then switch to the next day

I'm trying to create 24 appointments per day and after the 24th appointment has been created, I want my script to switch to the next day and then continue adding appointments hour by hour and so on. 1 appointment = 1 hour I'm using the following…
Klaus
  • 25
  • 5