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

C# oFlags['ui-comments'] not returning.

3 Answers 87 Views
Extensions and Customization
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 23 Oct 2019, 02:28 PM

Hi,

Quick question regarding the ability to programmatically obtain the ui-comment set against a session item in C#.

Currently I can set a value:

oSession.oFlags["ui-comments"] = "Comment Added"; 

This is displayed in Fiddler comments column against the request.

But when I attempt to get the value back out, in AutoTamperRequestBefore or AutoTamperResponseBefore there isn't a 'ui-comments' flag available.

Any suggestions gratefully received. 

Many thanks, and keep up the good work.

 

3 Answers, 1 is accepted

Sort by
0
Simeon
Telerik team
answered on 28 Oct 2019, 10:00 AM

Hi Rich,

Could you, please, share how and where, in which method or event handler, you are setting oSession.oFlags["ui-comments"] = "Comment Added".

Regards,
Simeon
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rich
Top achievements
Rank 1
answered on 05 Nov 2019, 09:38 AM

Hi Simeon,

Sorry for the delay in responding.

I have attached the method to attempt to explain further.

I can set a Comment in C# and see it in fiddler on replay.

I can set a Comment in Fiddler (using M shortcut), but when I replay that session I cannot retrieve that Comment in C# as it doesn't exist in the oFlag dictionary as expected.

Any ideas?

Thanks again,

Rich

 

0
Simeon
Telerik team
answered on 08 Nov 2019, 02:10 PM

Hi Rich,

Fiddler does not copy the session flags when it replays them. Here is how you can replay the sessions and keep the 'ui-comments' flag:

import System.Collections.Specialized;
//...

    ContextAction("Replay Sessions with Comments")
    static function MyReplay(oSessions: Session[]) {
        for (var i:int = 0; i < oSessions.Length; i++) {
            var sdSessionFlags:StringDictionary = new StringDictionary();
            sdSessionFlags.Add("ui-comments", oSessions[i].oFlags["ui-comments"]);
        
            if (oSessions[i].oRequest != null && oSessions[i].oRequest.headers != null) {
                FiddlerApplication.oProxy.SendRequest(oSessions[i].oRequest.headers, oSessions[i].requestBodyBytes, sdSessionFlags);
            }
        }
    }

This function will create a session context menu item "Replay Sessions with Comments", which you can click.

I hope that this suggestion will help you with your case.

Regards,
Simeon
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Extensions and Customization
Asked by
Rich
Top achievements
Rank 1
Answers by
Simeon
Telerik team
Rich
Top achievements
Rank 1
Share this question
or