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

Beanshell assertion successfull message in Jmeter

Given below code snippet i am using in beanshell assertion to verify the soap /json responses . if the both values (names) are not equals my bean shell assertion show failure message as given below(i could see the assertion failure in view result…
Vasanth
  • 474
  • 2
  • 9
  • 31
2
votes
1 answer

Extending JMeter Timer to delay timer variably

I'm using JMeter for my load testing. I want to extend the Timer to take in a delay in millis and then use it to delay the next sample. I am currently using BeanShell Script to accomplish this but I want to have a Java class for it rather than a…
AlexCon
  • 1,127
  • 1
  • 13
  • 31
2
votes
1 answer

How to edit the CSV file using JMeter means to overwrite the data in the CSV?

akshaygarg30,akshay.garg+30@jitterbit.com,NewUser,7Iron-hide I want to make "NewUser" to Activated in the CSV through the beanshell script or through any other way in the jmeter.
2
votes
4 answers

How to get random row from file in JMeter

I'm looking for way how to get random row from file in JMeter. I would be appreciate for any suggestions.
Kac
  • 184
  • 3
  • 15
2
votes
1 answer

Error when converting String to Long in beanshell processor in JMeter

I'm trying to convert a String to a Long integer, then do some calculations, then convert back to String. The entire code in the beanshell postprocessor is here (depositamount and imagecount are variables already known in JMeter): Long…
user3476534
  • 220
  • 1
  • 4
  • 15
2
votes
1 answer

If it possible to get average response time to variable in JMeter?

Obviously, I know that I have response time in .jtl file and in listener called Aggregate report, but I'm looking for way to get reponse time of request to variable.
Kac
  • 184
  • 3
  • 15
2
votes
2 answers

What are the pros and cons of using JMeterUtils.getProperty vs. __P in JMeter?

I'm working on some JMeter test plans that employ BeanShell assertions. Within these assertions I want to acess some user properties. There are several ways to access…
strauberry
  • 4,189
  • 5
  • 34
  • 50
2
votes
2 answers

How to generate hash(SHA1) using beanshell in JMeter?

How do I want to generate a hash using beanshell(SHA1) in JMeter to sign up to a application? I'm not able to get a substantial answer yet from net
Vinyasjain77
  • 31
  • 1
  • 7
2
votes
1 answer

Using Guava Optional with External SDK in JMeter

We are using an SDK that returns the type Guava Optional Optional in a method. In JMeter, we are using beanshell sample script to call that method in the following manner: Optional = new SDKClass().retrieveUser(...); The error that…
2
votes
1 answer

Beanshell not equal statement

What is if not equal statement in beanshell ? if this is equal : if ("myVarValue".equals(vars.get("MY_VARIABLE")))
Gandalf StormCrow
  • 25,788
  • 70
  • 174
  • 263
2
votes
2 answers

How to read multiple csv file from a location using Jmeter

I want My Jmeter to read multiple csv file from a location say c:\Jmeter\file. Currently if i provide the specific csv file name in'Filename' under CSV data Set Config, the Jmeter recognizes the file ans execute my script. I don't want to hard code…
2
votes
2 answers

variable is assigned a null value in jmeter beanshell sampler

Hi I am trying to assign value extracted from one sampler to another variable in a beanshell script. I have the below beanshell script. vars.put("linkArr",vars.get("${PlanLinksArray_1}")); the text request in jmeter is showing the below for…
mo0206
  • 791
  • 5
  • 20
  • 36
2
votes
8 answers

How would someone implement mathematical formulae in Java?

How would someone implement mathematical formulae in Java? What I mean, the user inputs a string with multiple variables. Like a simple quadratic formula: x^2 + 5x + 10. Or in Java: (Math.pow(x,2)) + (x * 5) + 10. The user would then enter that and…
Mohit Deshpande
  • 53,877
  • 76
  • 193
  • 251
2
votes
1 answer

Extracting certain data from JSON response using JMeter

I'm trying to extract the all "cash" values from SmallerList (into a list or an array) and compare them with each other, and later use the top value on a new request. I have been trying to write a script in BeanShell PostProcessor and failing. Any…
paxcow
  • 1,670
  • 3
  • 17
  • 32
2
votes
1 answer

jmeter sends empty http POST body data after BSF PreProcessor modification of a request

Does any one have a clue why jmeter is passing empty POST after I modify request body. I have a request with massive JSON in a body (unfortunately I can't paste an image with it) I have BSF PreProcessor attached to this request: import…