Unable to pass variable from one GET request to a second GET request

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to pass variable from one GET request to a second GET request

Mark Kocken
Hi all,

I have a GET request that passes back an xml that contains a ticket ID. I have setup a Regular Expression Extractor that extracts the Ticket ID and that in turn is used as a variable for the next GET request.

I checked the Debug Sampler and it is showing the correct string is being extracted. I have added the variable to the second GET request however when I run it I receive the following error messages.

Response code: Non HTTP response code: java.net.SocketException
Response message: Non HTTP response message: Socket closed

I have checked the request body in the Results Tree and it shows that the request is fine and the variable is being passed through correctly. I can even copy the whole request from the request body in the results tree and paste it into my browser and it works fine.

So I am really not sure what is happening, I was hoping someone may be able to shed some light.

1. Returned xml from first GET request with highlighted string to be extracted



2. Regular Expression to Extract the String



3. Debug Sampler Showing correctly extracted string



4. Second GET Request with variable applied



5. Sampler Result from results tree



6. Sending correct Request





I am also maintaining the same jsession id all the way through the process.

So I am really at a loss here.

Thanks you for taking the time to assist

Regards

Mark 



Reply | Threaded
Open this post in threaded view
|

Re: Unable to pass variable from one GET request to a second GET request

Felix Schumacher
The list strips most images -- in your case all are lost. Please use text.

Regards,

 Felix

Am 10.05.19 um 06:20 schrieb Mark Kocken:

> Hi all,
>
> I have a GET request that passes back an xml that contains a ticket
> ID. I have setup a Regular Expression Extractor that extracts the
> Ticket ID and that in turn is used as a variable for the next GET request.
>
> I checked the Debug Sampler and it is showing the correct string is
> being extracted. I have added the variable to the second GET request
> however when I run it I receive the following error messages.
>
> Response code: Non HTTP response code: java.net.SocketException
> Response message: Non HTTP response message: Socket closed
>
> I have checked the request body in the Results Tree and it shows that
> the request is fine and the variable is being passed through
> correctly. I can even copy the whole request from the request body in
> the results tree and paste it into my browser and it works fine.
>
> So I am really not sure what is happening, I was hoping someone may be
> able to shed some light.
>
> 1. Returned xml from first GET request with highlighted string to be
> extracted
>
> image.png
>
> 2. Regular Expression to Extract the String
>
> image.png
>
> 3. Debug Sampler Showing correctly extracted string
>
> image.png
>
> 4. Second GET Request with variable applied
>
> image.png
>
> 5. Sampler Result from results tree
>
> image.png
>
> 6. Sending correct Request
>
> image.png
>
>
>
> I am also maintaining the same jsession id all the way through the
> process.
>
> So I am really at a loss here.
>
> Thanks you for taking the time to assist
>
> Regards
>
> Mark 
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Unable to pass variable from one GET request to a second GET request

Mark Kocken
Thank you for the response. Will ensure no images in future.

Anyway I ended up adding a constant timer in the test and that fixed the
problem.

Again many thanks for your response.

Regards

Mark

On Fri, May 10, 2019 at 6:17 PM Felix Schumacher <
[hidden email]> wrote:

> The list strips most images -- in your case all are lost. Please use text.
>
> Regards,
>
>  Felix
>
> Am 10.05.19 um 06:20 schrieb Mark Kocken:
> > Hi all,
> >
> > I have a GET request that passes back an xml that contains a ticket
> > ID. I have setup a Regular Expression Extractor that extracts the
> > Ticket ID and that in turn is used as a variable for the next GET
> request.
> >
> > I checked the Debug Sampler and it is showing the correct string is
> > being extracted. I have added the variable to the second GET request
> > however when I run it I receive the following error messages.
> >
> > Response code: Non HTTP response code: java.net.SocketException
> > Response message: Non HTTP response message: Socket closed
> >
> > I have checked the request body in the Results Tree and it shows that
> > the request is fine and the variable is being passed through
> > correctly. I can even copy the whole request from the request body in
> > the results tree and paste it into my browser and it works fine.
> >
> > So I am really not sure what is happening, I was hoping someone may be
> > able to shed some light.
> >
> > 1. Returned xml from first GET request with highlighted string to be
> > extracted
> >
> > image.png
> >
> > 2. Regular Expression to Extract the String
> >
> > image.png
> >
> > 3. Debug Sampler Showing correctly extracted string
> >
> > image.png
> >
> > 4. Second GET Request with variable applied
> >
> > image.png
> >
> > 5. Sampler Result from results tree
> >
> > image.png
> >
> > 6. Sending correct Request
> >
> > image.png
> >
> >
> >
> > I am also maintaining the same jsession id all the way through the
> > process.
> >
> > So I am really at a loss here.
> >
> > Thanks you for taking the time to assist
> >
> > Regards
> >
> > Mark
> >
> >
> >
>