Persistently Filtering Out Application Traffic in Fiddler - fiddler

Whenever I start Fiddler, I see traffic from all of the applications on my system but it's very rarely the case that I want this. Usually what I want is to only see requests made by applications I am debugging. In order to achieve this, I leave Fiddler running all the time and whenever I want to see what happened with a request I can just open it up and see.
I can filter requests by right-clicking on an entry -> Filter -> Hide '<application name>'. Although this works fine, it is cleared when Fiddler is restarted.
How can I persist filters that filter out traffic from a certain application?
I tried using the Filters tab but this is very limited and one of the missing features is what I detailed above.

This can be achieved by creating custom rules. In order to do this, in Fiddler, go to Rules -> Customize Rules. You can choose Yes to install the FiddlerScript Editor plugin if you want but this is not necessary. Just click No when asked and a file named CustomRules.js will be opened using Notepad.
This file allows you to program all sorts of rules into Fiddler, from adding headers to outgoing requests to monitoring the time taken for a response to be received. Further details on it can be found here.
In order to filter out a certain application, scroll down to the OnBeforeRequest method and paste the following code in:
if (oSession["X-PROCESSINFO"] && (
oSession["X-PROCESSINFO"].StartsWith("firefox") ||
oSession["X-PROCESSINFO"].StartsWith("outlook") ||
false))
{
oSession["ui-hide"] = "FiddlerScript> Hiding unimportant process";
}
This piece of code tells Fiddler to hide all requests coming from Mozilla Firefox or Microsoft Outlook. If you want to add / update / delete any application here, all you need to do is copy / update / delete lines that contain the StartsWith method.
The first condition will filter out all the requests that do not come from an application. This is the case for requests made from Fiddler's Composer tab.

Related

How to generate system alias in /iwfnd/maint_service?

I have following problem:
I created an app and the according oData in frontend system. Everything worked fine. Then I was taught, that this was not correct and I have to create the oData in backend system.
So I made this. I created just the same oData in backend system, created another service for the new oData in transaction /iwfnd/maint_service in frontend system, changed the data source in the manifest of my app, and everything seemed to work fine. To add the app to the launchpad I needed one (or two?) more services in transaction SICF (paths sap/bc/bsp/sap and sap/bc/ui5_ui5/sap). Those were generated automatically for my "frontend-oData". As those weren't generated automatically in frontend system for my new "backend-oData", I added them manually. This seemed to work as well. So I transported everything into quality system (the app from WebIDE to SAP was transported as "updating an already existing application").
And now my problem:
Yesterday after transporting my app ran perfectly in just updated version. Today I get an error in quality system, that says:
"No systemalias for service 'ZEXAMPLE_SRV_0001' and user 'USER1234' found" (I translated this error message from german). This error is new to me and I did not have this before. The settings for my "frontend-oData" were different ones (no systemalias & service processing mode = "Co-deployed only") and they were generated automatically.
Now for my "backend-oData" in development system there is the setting "Routing-based" and the correct systemalias is maintained and the app runs perfectly there. But in quality system there is no systemalias maintained. So I transported the systemalias from development system to quality system, but that didn't work, because the systemalias has to be a different one in quality system.
I tried to make exact the same settings in quality system for my "backend-oData" as the "frontend-oData" has, but then in /IWFND/ERROR_LOG I get the message "No service for namenspace /SAP/, Name ZEXAMPLE_SRV, Version 0001 found."
So can anyone tell me the secret which step I need to do, that everything runs correctly again? I am desperated by now.
Many thanks and best regards
In your dev system open transaction /IWFND/MAINT_SERVICE and select the service in the service catalogue.
You should see the system aliases in the bottom right:
Press on Customizing and in the following view switch to edit mode:
As soon as you are in edit mode, you can select Table view > Transport. It will ask you to select an existing transport or to create a new one.
Two buttons will appear in the customizing view. Add to transport and Remove from transport.
Select the system alias row from the table and press Add to transport.
Now press save!!! Otherwise the alias will not be part of the transport. It's only "put on hold" when you press "Add to transport". Press save!!!
Move the transport to your next system (and eventually into production) if you want to use your OData service in other systems.

fiddler autoresponder not working

I added a rule (flash file), specified the new flash file I want fiddler to respond with (use instead of the browser one). I've cleared my browser cache, and every time I play the stream, the browser flash file is captured again (instead of auto-responding) with the one saved already!!!
It used to work just fine, but now it appears as if the auto-responder (although checked) is not working at all...it's just a pass-through!!!
As explained in the forum post where you asked the same question
There are three possibilities:
1> The AutoResponder itself is disabled (checkbox at the top)
2> The AutoResponder rule is disabled (checkbox at the left of the rule)
3> The rule you've written doesn't match the target request's URL.
Sharing a screenshot of Fiddler might help me tell you which problem you're encountering.
On the top of the list EricLaw gave in the previous answer, I add a new one:
You need to ensure your Fidler has the "Capturing Traffic" mode enabled. Either press F12 or go to "File" -> "Capture Traffic" and make sure you have a "Capturing.." icon on your left bottom corner.
I had a similar issue, and I solved it by enabling decryption of HTTPS traffic.
You can do this by going to Tools > Options > , then check Decrypt HTTPS Traffic
I had the same problem. I drag-dropped from the left, "main", window into the autoresponder so the "request matches..." column auto-populated. As a sanity check I unchecked "unmatched requests passthrough" to ensure that the match rule was indeed picking it up. If it hadn't nothing would appear in the main window at all. But it did appear so the rule was matching.
The issue with Fiddler is in the "then respond with..." column. Right-click for "Edit Response...", edit the response in the popup window of tabs, press Save, close the box.
When you retry your URL, your edited response isn't returned. Fiddler returns the original response. Even if you Edit Response again, it'll show what you typed in, but it never actually returns it.
To fix, you have to save the intended response to a file on your hard drive and edit it there.

Fiddler extension development: only operate on requests from composer

I'm trying to create a fiddler (v4.x) extension that builds and adds a custom header to requests generated by the composer. I started down the road of creating an IAutoTamper implementation that adds the header on the AutoTamperRequestBefore event. I quickly realized that this event fires for every request that passes through the fiddler proxy, not just for requests generated from the composer.
Is there any way to detect if a request was generated by the composer? Alternatively, is there a better extension point to handle this in other than through an AutoTamper?
If you right-click on a session in the Web Sessions list, you can choose Properties to see all of the Session Flags set on that session. You'll notice that all requests from the composer have a flag named X-From-Builder.
So, in your extension's code, you can simply write:
// Inside AutoTamperRequestAfter
if (oSession.oFlags.ContainsKey("X-From-Builder")) {
// Whatever...
}

Testing with dual UI's

I have a browser based test program for testing a browser based application. This means that I need to record sequences that alternately manipulate the test program and then the application to check that it reacts correctly, so that I can perform automated testing.
How should I do this with SAHI?
I cannot see a way of recording two separate URL's concurrently. I have tried combining the two UI's using frames, and iframes, but I couldn't get SAHI to record in the frame/iframe.
I could modify the test program so that I can call it from scripts called by SAHI, but that rather defeats the object of having an automation tool...
Any suggestions?
1) Record the actions on the first web page using Sahi (script1)
2) Record the actions on the second web page (script2)
3) In script1, do this
// do steps for UI 1 as recorded in script1
_call(window.open("second url", "newWindow")); // open the second window
_selectWindow("newWindow"); // target the following steps on newWindow
// copy steps from script2 here
_selectWindow(); // return to base window
// perform further base window steps
// Use _selectWindow("newWindow") and _selectWindow() to switch between windows.
Hope this helps.
Regards,

How do you set up an Optimizely test for a single-page app?

I have a single-page web app that presents a multi-step photo management "wizard", split up across several discrete steps (photo upload, styling, annotation, publishing) via a tab strip. On switching steps I set the URL hash to #publishing-step (or whichever step was activated).
How do I set up Optimizely tests to run on the various discrete steps of the wizard?
The browser never leaves the page, so it only gets a single window.load event. Its DOM isn't getting scrapped or regenerated, but just switches what page elements are visible at any one time via display: none or block, so the part I am trying to figure out is really mostly about in what way I go about the Optimizely test setup itself - it's fine (and likely necessary) if all edits get applied at once.
This thing unfortunately has to work in IE9, so I can't use history.pushState to get pretty discrete urls for each step.
There's actually several ways you could go about doing this, and which option you choose will largely depend on what's easiest for you AND how you plan to analyze the data.
If you want to use Optimizely's analytics dashboard:
I would recommend creating one experiment which will activate a bunch of other experiments at different times. The activation experiment will be targeted to everyone and run immediately when they get to your wizard. The other experiments will be set up with manual activation and triggered by this experiment.
The activation experiment would have code like:
window.optimizely = window.optimizely || [];
function hashChanged() {
if(location.hash === 'publishing-step') {
window.optimizely.push(['activate', 0000000000]);
}
if(location.hash === 'checkout-step') {
window.optimizely.push(['activate', 1111111111]);
}
}
window.addEventListener('hashchange', hashChanged, false);
Or you could call window.optimizely.push(['activate', xxxxxxxxx]); directly from your site's code instead of creating an activation experiment and listening for hashchange.
If you want to use a 3rd party analytics tool like Google Analytics:
You could do this all in one experiment with code similar to above, but in each "if" section instead of activating an experiment, you could run your variation code that makes changes to the wizard and sends special tracking information to your analytics sweet for later reporting. You'll have to do your own statistical significance calculation for this method (as Optimizely's data won't be "clean"), but this method actually works out better usually if properly configured.
Alternatively you could use the method outlined above but still try to use the Optimizely analytics dashboard by creating custom events on your experiment and sending data to them using calls like window.optimizely.push(["trackEvent", "eventName"]);
This article may also be helpful to you.
You'll probably need to do this yourself, using Optimizely's JS API to trigger actions on their end and tell it what your users did: https://www.optimizely.com/docs/api