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

FiddlerCore Auto-respond with sessions loaded from SAZ file-

1 Answer 138 Views
FiddlerCore
This is a migrated thread and some comments may be shown as answers.
Kallol
Top achievements
Rank 1
Kallol asked on 12 Jul 2017, 02:21 PM

Hi,

I am using FiddlerCore to perform the below functions in order

     - Running fiddler core and storing the sessions in a SAZ file

     - Uploading the SAZ file and load sessions

     - Using autoresponder to respond to a session from the loaded session(if it exists)

I am using the following code to auto-respond

foreach (Session loadedSession in loadSessions)
                {
                    if (loadedSession.fullUrl.Equals(oS.fullUrl))
                    {
                        Console.WriteLine("Session Available in Loaded Session");
                        oS.utilCreateResponseAndBypassServer();
                        oS.requestBodyBytes = loadedSession.responseBodyBytes;
                        oS.oResponse.headers = loadedSession.oResponse.headers;
                        break;
                    }
                }

Where loadSessions are loaded from SAZ file

But I am not getting receiving any response if i open the pages for which the session have been loaded.

What am I doing wrong and what should be the correct approach.

Thanks in advance !!!!

1 Answer, 1 is accepted

Sort by
0
Kallol
Top achievements
Rank 1
answered on 14 Jul 2017, 09:20 AM

Hi,

Got the answer. used - oS.utilSetResponseBody(loadedResponseBody)

To set the response of the session where loadedResponseBody is a string from the session which is stored in SAZ file.

Regards,

Kallol

Tags
FiddlerCore
Asked by
Kallol
Top achievements
Rank 1
Answers by
Kallol
Top achievements
Rank 1
Share this question
or