0
votes

I Have a setUp Thread group in which i am creating A resource with unique Id,path it will give me a url to test

In main Test group I have to Test each url created in setupthread group needs to be rigorsly tested. testplan

In tearDown thread group i need to clear the setupgroup creation .

The problem i am facing is , the property value is getting overridden

Suppose say in SetUpthread group i have created 10 resources then its the last resouce always the mainTest thread group is getting executed

I am looking for a way foreach setupThread group resource the mainTest theadgroup must execute the no of times i specified in the TheadCount and LoopCount

eg: setUpThread group ThreadCount is 10 and Loop count is 10 then i will get 100 different unquie resources would be created then its the mainTest ThreadGroup

100 TC , 100 LC i.e., for each resource its 10000 times gets invoked .

please help me in acheiving this attached pic

2

2 Answers

0
votes

You can take a look at http://jmeter-plugins.org/wiki/InterThreadCommunication/ plugin.

This will help in your case. Let me know if this works.

0
votes

It is hard to suggest anything without having your test plan itself so here is just an approach, I don't guarantee that it'll work, however the idea should be fine.

You need to set up as many properties as many URLs you would like to be hit in the main thread group.

For instance, if you write some URL down in JSR223 Sampler using __counter() function output as postfix like:

JSR223

This will generate the following properties:

URL_1=http://some.url
URL_2=http://some.other.url
etc.

After that in 2nd Thread Group you can add another JSR223 Sampler to convert JMeter Properties to JMeter Variables like:

Enumeration e = props.propertyNames();
while (e.hasMoreElements()) {
  String propertyName = e.nextElement().toString();
  if (propertyName.startsWith("URL_")) {
      vars.put(propertyName, props.getProperty(propertyName));
  }
}

Then you should be able to use ForEach Controller to iterate the variables.

Also make sure you use Groovy as JSR223 PostProcessor and Sampler language