0

enter image description hereI've created in Jmeter the follwing:

  • HTTP Request (first one)

  • (Regular Expression Extractor) for the Response Body (I set the name of the variable, and put the correct regular expression,which works fine and returns the searched pattern)

  • (ForEach Controller) to iterate the Array (and of course I put the name of the array variable, and the ouput variable name (index))

  • another subsequent Http Request under (ForEach Controller Level) (then I put the value index of the array on the path like: /${smalpl_index}

    Now I expect the second http Request below the (ForEach Controller) make a new Request based on the index Element of the Array from the Regular Expression, however I got null on the request...(see below)

Hier you find all the screenshot of the test scenario:

https://i.stack.imgur.com/HGeBA.jpg

GET http://edge.flowplayer.org/null

Community
  • 1
  • 1
otmann
  • 37
  • 2
  • 17

2 Answers2

0

I see only one request in your screenshot and my expectation is that you should have at least one passed HTTP Request (first one)

In the Regular Expression Extractor make sure to set "Match No." to -1

enter image description here

Add Debug Sampler after the HTTP Request (first one) and make sure it contains the variables you're looking for, in order for ForEach Controller to work you need to have the following variables pattern:

var_1=some value
var_2=some other value
etc.

Check out Using Regular Expressions in JMeter article for example of extracting all links from the page and opening them via ForEach Controller.

Also for the majority of HTML responses using Regular Expressions is not the best idea, it might be better to consider CSS Selector Extractor

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • sorry this is not the only reuqest I have....I have the problem on my scond request after the (FoeEachController)..I passed this second request an Index Variable on the path but she retuns null – otmann Mar 25 '20 at 12:59
  • under this link enclosed a clear screenshots of my test: https://imgur.com/a/Eqbk9Mx#cp5raNc – otmann Mar 25 '20 at 13:31
0

The problem was in the regular expression template,since I'm searching for the entire pattern , I should not put $1$, instead of $0$,because $1$ means the second group number, and in my case I have one group, and so it works fro me...

otmann
  • 37
  • 2
  • 17