0

I am testing a login system which stores a session in a variable. The variable is dynamic; meaning, its value changes for every request. I followed this tutorial http://sjpknight.com/correlating-dynamic-values-in-jmeter/ for doing this.

Now, the thing is, this session variable (${session_store}) auto generates only for the first time it is called in my http samplers (I call it thrice in my application). The second time I call it, the value it has is the default value I stored in it in the Regular Expression Extractor element. Meaning, the auto generated value in the first variable call is not received by the second variable call. Right now, I am having an error since the values of the two variable calls are not the same. Any suggestions on how to fix this?

Harold Decapia
  • 375
  • 1
  • 8
  • 23
  • Share your test plan and Regular Expression as well so we would be able to figure out where's the problem. – Adnan Nov 17 '16 at 03:18

1 Answers1

0

Add View Results Tree listener to your Test Plan and inspect the response in all 3 cases. As far as I understand you expect the same or similar response as in the 1st case and most likely it is different. You can test your Regular Expressions agains live responses directly in the View Results Tree listener using RegExp Tester mode

RegExp Tester


In general when it comes to Regular Expressions and HTML you can never tell whether your expression provide a match or not as it depends on multiple factors and even a slight change in the markup, i.e. value you're looking for starts coming in 2 lines, will ruin your test so I would recommend to go for CSS/JQuery Extractor or XPath Extractor instead

Community
  • 1
  • 1
Dmitri T
  • 159,985
  • 5
  • 83
  • 133