I would like to write an automatic test that goes on a production webpage which is using a specific library and replace it with the version I have on local.
This is useful for me to verify that when a new version of the library will be released to different pages they won't break (kind of smoke test).
For manual test atm I use Requestly to replace the host of the network request to that library, I'm wondering which would be the best test framework/approach to have an automatic test for that.
You can try the following approach:
Please note that you have to repeat Steps 1-4 everytime you open a new chrome instance using Selenium (or any other framework). It may increase your automation suite running time a bit but atleast it achieves what you want.