abhishekrvce
abhishekrvce

Reputation: 185

How to put multiple breakpoints in fiddler?

In fiddler we can put breakpoints by follwoing commands:-

[bpv or bpm] Create a request breakpoint for the specified HTTP method. Setting this command will clear any previous value for the command; calling it with no parameter will disable the breakpoint. bpv POST bpv <-- Call with no parameter to clear

[bpu] Create a request breakpoint for URIs containing the specified string. Setting this command will clear any previous value for the command; calling it with no parameter will disable the breakpoint. bpu /myservice.asmx bpu

I want to break on the request if

a) If request is made for http://url_1/dummy1.svc

b) If request is made for http://url_2/dummy2.svc/DoWork (called from yui ajax request)

Both the url are making POST request. So I tried with bpv POST command, but it breaks only for 'a' scenario.

I gave bpu http://url_2/dummy2.svc/DoWork and bpv POST command. But It seems bpv work but not bpu. If I give bpv POST and bpu http://url_2/dummy2.svc/DoWork then bpu works but not bpv.

Let me know the way how I can use both bpu and bpv at same time?

How can I use fiddler to capture both urls request?

Thanks,

Upvotes: 4

Views: 3255

Answers (2)

EricLaw
EricLaw

Reputation: 57095

Click the AutoResponder tab.

Add two new entries with the Rules and ActionText as follows:

http://url_1/dummy1.svc           *bpu
http://url_2/dummy2.svc/DoWork    *bpu

Alternatively, click Rules > Customize Rules. Scroll to OnBeforeRequest and add

if (oSession.HTTPMethodIs("POST"))
{
    // Careful, URLs are Case-Sensitive...
    if ((oSession.fullUrl == "http://url_1/dummy1.svc") ||
        (oSession.fullUrl == "http://url_1/dummy2.svc/DoWork"))
    {
        oSession["X-BreakRequest"] = "script";  
    }
}

Upvotes: 6

Sixto Saez
Sixto Saez

Reputation: 12680

Looking at the built-in rules code in Fiddler (type ctrl-r in Fiddler), here is how breakpoints are set:

if ((null!=bpRequestURI) && oSession.uriContains(bpRequestURI)) {
    oSession["x-breakrequest"]="uri";
}

if ((null!=bpMethod) && (oSession.HTTPMethodIs(bpMethod))) {
    oSession["x-breakrequest"]="method";
}

This logic implies that the URI and Method based breakpoints are mutually exclusive. I don't know enough about creating custom rules to know if a composite rule can be created that does what you need.

Upvotes: 0

Related Questions