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

JMeter - Generating a Summary Report

I've implemented a BeanShell listener in my Jmeter test plan which I use to run a script that sends information after each request into Splunk. However, I'd now like to be able to generate a similar message at the end of each Thread run, regardless…
Paddy
  • 523
  • 1
  • 6
  • 29
0
votes
1 answer

Beanshell How do I convert a string to a datetime

I'm using beanshell and I need to convert a string in the format '2012.08.14 07:30:00.000' to date time integer in the format 1344925800000 Does anyone have any ideas? Thanks in advance Al
0
votes
1 answer

How can i copy one file from one directory to another directory in JMeter?

I am trying to copy one file from one directory to another directory using Telnet Server. Can we do this in Jmeter. I am using Beanshell Sampler for that. Please anyone guide me on this. Thanks in advance, Anto
user28
  • 249
  • 2
  • 7
  • 20
0
votes
3 answers

How to create a Java object from a string representation at runtime

Eg if I have a string "{1,2,3,4,5}" I would like to get an int[] object from that string. I have looked a bit at Janino and Beanshell, but can't seem to find the correct way to get them to do this for me. I am looking for a generic solution, one…
Mellson
  • 2,918
  • 1
  • 21
  • 23
0
votes
1 answer

Functional testing with Jmeter

I want to check if the value of a cookie change after each reload of a web page. I've tryied to use beanshell for the purpose but haven't succeed yet. Any example or tutorial ?
Dinh
  • 1
  • 1
-1
votes
1 answer

response of 1st request should be used as header request for 2nd one

I have a issue in writing a code in jmeter where it is a adaptive way(i.e., response of 1st request should be used as header request for 2nd one) should use bean shell and writer coding and this should be done for n number of request fetching every…
-1
votes
1 answer

Compilation error when passing Java code to Beanshell

So, I am using BeanShell PostProcessor to write the json data to csv file . This is my code in beanshell postprocessor. import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import…
Sandesh
  • 9
  • 2
-1
votes
1 answer

How to relate one array values with other in Beanshell

I have a scenario where I have arrays like Names(Mike, Harry, Jones, Jack, Jimmy) Rank(4,2,1,3,5) and Rollno(S12,S76,S89,S87,S99). I need to capture lowest rank and associated name and roll no in beanshell. I'm expecting to capture lowest rank and…
Mikey8997
  • 7
  • 2
-1
votes
1 answer

bash shell script transmission variable value space processing, how to space data it

bash shell script transmission variable value space processing, how to space data it **#FileList. list.txt Delivery list belowt** $1 $2 $3 xxxx1.com_1 Hello_2 Hello_3 - Hello xxxx2.com_1 Hello_2 Hello_3 - Hello get_list()…
study
  • 1
  • 5
-1
votes
2 answers

Sample result's label is not changed through BeanShell post processor for some conditions

I made this code so that if status == 500 the name of the api would be equal to "FAKE_CLIENT_RETRY", if the status of the api == "ERROR", the name would be equal to "FAKE_CLIENT_CALLBACK_ERROR" import…
QA_V
  • 25
  • 6
-1
votes
1 answer

How to generate new thread groups via beanshell in Jmeter

I have created a beanshell script in beansheill Timer where I am adding delay between requests. That delay is calculated based on a csv file where I have timestamps all requests. Now problem I am facing is Within a thread group If one request is…
-1
votes
1 answer

How to write unit test cases like JUnit for a bean shell script

I have a Bean Shell script and I want to know how can I write test cases like JUnit?
Zaka
  • 1
-1
votes
1 answer

JMeter -Groovy or Beanshell script for editing values in a excel

I am having a JMeter test case to upload an .xls file with multiple tabs of data . The data should be unique for each iteration Each tab has 100 values as ASDFG0002 ASDFG0002 POIUY0002 The ‘0002’ needs to be replaced for each iteration in…
Devika
  • 21
  • 1
  • 6
-1
votes
1 answer

Jmeter: Request should be change as per previous response

{ {"status": {"id":2,} } Next service should be { "Data":"ABC" } similarly : set Data = "DEF" if Id = 2 , Data = "GHI" if id = 3
-1
votes
1 answer

If controller stop loop instead of creating new iteration - Jmeter Groovy

I have an issue that I am trying to solve, I have a loop controller and inside it I created if controller. I want something to be done if the "if controller" is true. the condition is that: def loop_counter2 = ${__counter(TRUE)}; and the if…
Bastian
  • 1,089
  • 7
  • 25
  • 74