0
votes

I'm new to jmeter and I'm facing an issue with Regular Expression Extractor.

Details:
Http request: /apps/Account/LogOn/TestFirm

This is the response I've received (I've edited for security purpose). The response from the result tree appears to be from redirected message, probably its hidden response.

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://xxxxxxx.xxxx.xx.xxx.com/idp/xxxxx?ClientID=LandingPage_Dev&amp;SAMLRequest=fZJR...................CWfsOv17a4G70I2zPlSTrKdX3%2F7G9TM3D">here</a>.</h2>
</body></html>
!DOCTYPE html>

Now I need to capture SAMLRequest and I've used Regular Expression Extractor with the below information:

Reference Name: SAMLRequest
Regular Expression: SAMLRequest=(.+?)">here 
Template: $1$
Match no (0 for random): 1
Default value:

And in the following HTTP Request I've used ${SAMLRequest} and in the request message it goes as ${SAMLRequest} instead of the value. I think nothing is being captured.

Can anyone please help me on how to capture the hidden response as shown above?

Also, what is RelayState? Is it applicable here?

Edit:

191 - is where the SAMLRequest is received from the response.
I have added Regular Expression Extractor, I guess here the value is hidden or something?

193 - I'm using ${SAMLRequest} and in the request body I can see

&SAMLRequest=${SAMLRequest}

instead of the actual value.

3

3 Answers

1
votes

You may want to check the "Apply to" checkbox in the Regular expression extractor. This parameter defines which regular expression will be applied to either only main sample results or to the embedded resources too.

0
votes
  1. The Reg Ex which you have written is correct, Check where exactly this SAMLRequest is generating and use the Reg Ex there.

  2. Try to use the match no as 0 and also make sure that the filed to check is Response Headers(since i could see that the value is generating in the header tag) and the regular expression

0
votes

You may want to consider doing this with a BSF preprocessor, This will give you the full range of java string parsing operations.

Of course, there will be a way to make this work with a regular expression extractor, but BSF preprocessor, should work equally well, and may allow you to get around a roadblock by using a syntax you are more used to (if you are more used to java)