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

How to set system property using testng.xml and beanshell

I have an XML configured like this
1
vote
2 answers

Why does my JMeter While Controller Loop Infinitely?

I'm trying to set up a JMeter run that does this: Make Rest API request Use a JSON Extractor to check the response for a given array of values. I define success as all of the "Items[*].Success" nodes equaling "true" If the response is…
user2023861
  • 8,030
  • 9
  • 57
  • 86
1
vote
2 answers

How to Capture Jmeter test metrics like test start time, end time, number of users and pass it to rest API call

I am new to JMeter. I have two scripts one script is web and another is a rest api call which posts metrics to server. Both the scripts are working fine. Now i wanted to implement a scenario. Web Script should run first once the script is completed…
1
vote
2 answers

Jmeter Benashell Post processor error -- How to do please suggest

Not able to generate file using beanshell post processor.. trying to calculate time difference as well ******* Beanshell Post processor code ***** import java.text.DateFormat; import java.text.SimpleDateFormat; import…
1
vote
1 answer

Using beanshell variable in subsequent While loop

I need to use variable from beanshell in my while loop, but I am not able to see the value of variable coming through. output variable of my JDBC select count(*) query is "count_num" using following code in beanshell: int id =…
vsingh
  • 125
  • 1
  • 2
  • 16
1
vote
1 answer

Unable to use Beanshell Pre processor varible in another request

Unable to use the Bean Shell Pre-Processor variable in the HTTP sampler or in another HTTP request. Thread Group Random variable - Id HTTP sampler (XML body - ${var1}) BeanShell Pre Processor vars.put("RANDOM_NUMBER",…
la1
  • 519
  • 1
  • 8
  • 30
1
vote
1 answer

"Executing a test in testNG based on condition"

i have a testNG xml which will execute a (one)test case 2 times. the difference between each time is the test level parameter. so i have to execute the test case with 2 different parameter (2 user). Now i will be creating new xml (suite of xml) from…
kannan
  • 35
  • 5
1
vote
0 answers

I am unable to get the output of a Jmeter hash function

I am doing double hashing of few parameters and the 2nd hashed value I want to use in my jmeter script as a parameter.But my output is not getting into the parameter value.Please help I have written the hash function of the variables in a Beanshell…
user3627319
  • 395
  • 3
  • 10
  • 19
1
vote
1 answer

Replace characters in the string with some other characters produce exception

I'm extracting some value using regular expression say "Ehj113GPTAw9RMbTgxce2jqh+2rn7tLWFz5JHyhxa+K68ksbE3O5MPvvLU4ihAeaE08DlO7X04MpSVRP7jZIHGv0qPzdmJgwXZUOmVwFWNTQZbpH" I want to replace the '+' with '%2B' and send it to the second request as…
Yadnesh
  • 21
  • 1
  • 5
1
vote
0 answers

How to structure Multiple array of JSON in the beanshell sampler

How to structure Multiple array of JSON in the beanshell sampler for example i need to pass N number of articles to a loop , so i have created a for loop to fetch the articles. here i have mentioned 3 articles as an example. but i need to fetch N…
Raksha
  • 11
  • 1
1
vote
0 answers

Calling a ".bsh" Script from an ActionListener in a ".bsh" Script

I wrote a beanshell script (.bsh file) to call another beanshell script when a button is clicked. The code runs fine when the beanshell script is called from the main body of the code, but crashes when called from within the button's Action…
Bhaskar
  • 11
  • 3
1
vote
2 answers

Pass a variable in bean-shell assertion Jmeter

I try to pass 2 variables to the BeanShell script of Jmeter but it fails with the error. However, if I pass a hardcoded string value, it works. Beanshell assertion to compare variable AdID1 and MAdID1 String addrress1="${AdID1}"; String…
1
vote
1 answer

How to write dynamic variable in beanshell post processor?

We have user defined variable name as "search". I am using below line to write in csv file in beanshell postprocessor but its showing me "void" in csv file: print(${search}); please help.
Anonymous
  • 109
  • 2
  • 12
1
vote
1 answer

Unable to append to next line in a file through beanshell assertion sampler in Jmeter

Have 2 steps in my JMeter script. Login and Second getting the orders, inside the login thread group I am using a bean shell assertion to validating few conditions and once I hit with an error I am writing the error to a log file. So for the first…
Jyoti Prakash Mallick
  • 2,119
  • 3
  • 21
  • 38
1
vote
2 answers

JMeter Beanshell Get Text File Size Save to Variable

In Beanshell Post Processor I am creating a file and writing variable data received from a JDBC request to that file. I need to capture the file size of the created text file in KB and save to a variable so that I can call in a subsequent JDBC…
user2642587
  • 45
  • 1
  • 2
  • 10