This is a migrated thread and some comments may be shown as answers.

sample rule for correlating session id

8 Answers 114 Views
FiddlerCore
This is a migrated thread and some comments may be shown as answers.
Srikar
Top achievements
Rank 1
Srikar asked on 26 Nov 2014, 01:38 AM
Hi,

Does somebody have a sample rule to capture a sessionId from a response and use it as an input in the subsequent request?

Sorry, if this issue is already answered before. I am very new to fiddler.

Sample could be for any standard application on the web. Like login/logout to twitter or yelp etc.

Thanks much in advance.

Regards,
S

8 Answers, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 26 Nov 2014, 02:26 PM
Hello, Srikar--

The details of such a script are highly dependent on the exact scenario in question; there's no "standard" for how session ids are transmitted or used.

https://groups.google.com/forum/#!searchin/httpfiddler/utilissuerequest/httpfiddler/CyXSDkug_es/V3zBA0OeNjcJ provides an example of how you can issue requests from Fiddler based on any data you like. https://groups.google.com/forum/#!searchin/httpfiddler/utilissuerequest/httpfiddler/8T4ZOsOm20E/W5A_d-NEJDYJ offers some additional context.


Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Srikar
Top achievements
Rank 1
answered on 30 Nov 2014, 01:00 AM
Hi Eric,

Thank you much for the reply. I am going over the posts. But basically this is what I need on a very generic level:

- capture a string from the response body, by giving left boundary and right boundary or the name of the response header value we want to capture:

Example left boundary : <div class="gb_pa">
Example right boundary: </div>
The function should copy the value between these strings and saves it in a variable. - paValue

- Now use the value in the subsequent HTTP request:

http://<myhost>:8080/actionmode=replyPost&postId={paValue}

Thanks,
Srikar


0
Eric Lawrence
Telerik team
answered on 01 Dec 2014, 04:52 PM
Sure, Fiddler can do this.

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Srikar
Top achievements
Rank 1
answered on 01 Dec 2014, 08:54 PM
Thanks Eric. Great to know that we can do this in fiddler.

Do you have any sample to show how to do this?
or what function I need to use to capture the data before the response object.
function to save the captured value to a parameter
and a way to give that parameter in the subsequent request

I would really appreciate your help with this.

Thanks,
Srikar

0
Eric Lawrence
Telerik team
answered on 01 Dec 2014, 09:49 PM

What have you tried so far?

I can't write your code for you because you still haven't defined the problem well enough.

How does one recognize the response for which the specified token should be sought?
How does one recognize the request to which the specified token should be inserted?
Is the subsequent request generated by the client application, or is the request expected to be generated by Fiddler itself?

Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Srikar
Top achievements
Rank 1
answered on 02 Dec 2014, 12:27 AM
Hi Eric,

I am very new to Fiddler and haven't started coding with scriptEditor yet. So far recorded a web transaction and could save it as HAR2 file and run it.

I will break down my project in a smaller tasks and start writing code. The smaller tasks would be:

- grabbing a text from response, when the left boundary and right boundary are specified
- saving the text grabbed from step 1 to a variable that I can pass to a subsequent HTTP request
- select the next immediate HTTP request that is sent via fiddler script
- replace of value in the request URL or request header, with the variable created in step 2

Thanks for giving the confidence that this is doable with fiddler (without recompiling the product itself etc.)

Best Regards,
Srikar
0
Srikar
Top achievements
Rank 1
answered on 02 Dec 2014, 12:32 AM
by the way, I know beforehand that the value I am looking for will come as a response to the third HTTP request that is sent by my script.

So I need figure out how a rule will be applied to a specific response object and not to all response object in my script. And to target a specific request that is inside fiddler script for adding the variable
0
Eric Lawrence
Telerik team
answered on 02 Dec 2014, 11:45 PM
http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrResponse has examples that show how you can target behavior based on the URL, host, or other headers of the request.

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
FiddlerCore
Asked by
Srikar
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Srikar
Top achievements
Rank 1
Share this question
or