1

Code is:

<input name="__RequestVerificationToken" type="hidden" value="Yekn8BJNbXaydRs8yq1GEmDogsFoSh8AGyOKmjLn0zFvhmADPYrqU43/foLoEzJk4yEeNSg78pCIJh6uxuyWf9foM7VsZayC2trOXwUA2hyUWSAf9mBC8vN60ccAVki37fC1LNHhAlDkthgmsM3WNxJwvVGWMj2TMqoONGI0aj5b2hJkQMMClKx0zhthqtD8" />

My Jmeter config. is given below as screenshot :

Extracting Expression

Post Data

What is incorrect I did here :( It is not logging & giving error : Object moved to here

Helping Hands
  • 5,292
  • 9
  • 60
  • 127

2 Answers2

2

In your regular expression extractor, your regular expression needs to be

<input name="__RequestVerificationToken" type="hidden" value="(.+?)"

instead of what you have now. It should work once you change that.

jgabb
  • 542
  • 1
  • 4
  • 20
  • If this worked, please mark as answer @Helping Hands – jgabb Sep 02 '15 at 17:18
  • Should I put with input tag? in regular expression? – Helping Hands Sep 03 '15 at 02:54
  • Yes put exactly what the code is showing because that's the pattern the regex extractor will look for. It needs to be exactly like the code, with the part you want to extract within the parenthesis. – jgabb Sep 03 '15 at 03:13
  • It will work either way. @HelpingHands It doesn't need it. Because it will go until it finds the " at the end of the token. – jgabb Sep 03 '15 at 13:20
  • Hey I tried in all way but still getting ERROR for __RequestVerificationToken :( – Helping Hands Sep 07 '15 at 05:33
0

This is why you shouldn't use regular expressions for parsing HTML: one of the reasons is that HTML-oriented regular expressions would be very fragile and sensitive to any line-break, space, tags order, etc.

So the options are:

  1. CSS/JQuery Extractor. Relevant config would be:

    • CSS/JQuery Expression: input[name=__RequestVerificationToken]
    • Attribute: value
  2. XPath Extractor. Configure it as follows:

    • XPath Expression: //input[@name='__RequestVerificationToken']/@value
    • if your response is not XML/XHTML-compliant you'll also need to check Use Tidy (tolerant parser) box
Community
  • 1
  • 1
Dmitri T
  • 159,985
  • 5
  • 83
  • 133