Click here to Skip to main content
15,885,216 members
Articles / Web Development

Fiddler for Model Driven Apps

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
19 Jan 2021CPOL2 min read 4.6K   2   1
How Fiddler for model driven apps works and getting started
There are commercial tools available for model-driven apps to make testing simpler but still using Fiddler has advantages. This first post of this series will explain how it works and how to get started with it.

While developing ‘PowerApp Components’ and traditional ‘Web Resources’, a common challenge is that testing is not straight forward. To test a change in HTML or JS code, one needs to deploy files, which is time-consuming. There are commercial tools available for model-driven apps to make it simpler but still using Fiddler has advantages. This first post of this series will explain how it works and how to get started with it.

What is Fiddler?

Fiddler is a web proxy debugging tool often used by web developers. Basic version which we need is free forever and can be downloaded from here.

How Does It Work?

First, we add a web resource shell in the model-driven app, so if it JS, a file with just function name is fine. We still need to configure that function to trigger on load or save events in form properties. From this point on, we can start using Fiddler. We code in Visual Studio, configure Fiddler and open model-driven app in a browser. Fiddler will interrupt incoming request and replace JS file coming from cloud with file open in Visual Studio. Do a code change, just refresh and see the latest JS change without deploying it in app.

Benefits

  1. We can test JS/ HTML code without deployment. Do code change in Visual Studio, refresh your browser and verify changes.
  2. One can debug or develop without affecting other developers or users. Complete your work and when done deploy for testing.

Steps

  • Add web resource to model-driven app if it is a new resource. For details about web resources, see this link and links under “See Also” section of it.
  • Install Fiddler
  • From Fiddler > Tools > Options > HTTPS, do the following:
    • Ensure “Capture HTTPS CONNECTs” and “Decrypt HTTPS traffic” are checked.
    • In drop down “…from browsers only” is selected.
    • Certificates generated by” has “CertEnroll engine”.
    • Click “Actions > Reset Certificates” and accept all prompts.

  • Under Filters tab, do the following configurations, these will help in targeting only relevant requests:
    • Use Filters” check box is checked.
    • Ensure for “Hosts”, “Show only Internet Hosts” is selected.
    • Add your app URLs.
    • Show only if URL contains” is checked and it has “/webresources/”.

  • In “AutoResponder” tab, do the following configs. Here, we are telling which web resource we are working and what is the location of development version:
    • Enable rules” is checked.
    • Click Add Rule.
    • Enter regular expression with name of JS file like “regex:(?insx).+/account.js”.
    • Enter path to development version of file on local disk.
    • Press Save button.
    • Ensure rule created is enabled.

  • Check “Capture Traffic” under file menu:
  • Refreshing browser Fiddler should start capturing traffic. If we open the browser’s dev tools, we can see code changes reflected without deploying them.

I hope it was helpful.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Australia Australia
Developer

Comments and Discussions

 
QuestionNo images Pin
colins220-Jan-21 23:14
colins220-Jan-21 23:14 
QuestionMessage Closed Pin
20-Jan-21 14:59
professionaljaz baz20-Jan-21 14:59 
QuestionMessage Closed Pin
20-Jan-21 4:29
The Untold Recipe20-Jan-21 4:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.