I'm using mountebank to stub out some services for testing. I'm pretty new to mountebank so these are pretty simple http stubbing examples. I'm loving the restful API, and GUI access to see clearly what's going on at all stages during development & debugging of the tests.
But I also have a requirement to examine & test the network traffic being generated by the application I'm testing via a selenium testing framework.
The only way I've found so far is to use browsermob-proxy and attach it selenium as a proxy server :
"proxy": {
"proxyType": "manual",
"httpProxy": "localhost:8082"
}
This seems to me to be acting as a simple pass through proxy that records all network traffic in a .HAR http archive format which I can examine in my tests.
This is necessary because I'm testing the integration of third party javascript libraries, and I can't simply override them to point at a stub - so need to record all the ajax calls.
I don't necessarily want to use mountebank AND browsermob-proxy.
I'd prefer to use mountebank but couldn't figure out a way of acheiving the network traffic recording I need.
Is there a simple way of setting up mountebank as a simple pass through proxy that can record all interactions coming from a selenium testing framework?
Thanks for making mountebank.
--
You received this message because you are subscribed to the Google Groups "mountebank-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mountebank-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
thanks for the reply. I really appreciate it.
I'm not sure, but I don't think the example you gave does quite what I'm looking for.
For example, my app is running on port 3000, and Selenium is running on port 4444 - but I can tell selenium to run through a proxy on port 8082. Effectively this tells the browser that runs during tests to use a proxy on port 8082. (It's like going in to Firefox's settings and manually setting the browser to use a proxy on that port) Third party javascript libraries might generate ajax calls from my app to "abc.com" and "xyz.co.uk" that I want to 'examine'. I have no way of overriding these endpoints to point at a typical mountebank imposter.
With browsermob started on port 8080, I can curl a restful request to it, to start a proxy on 8082 which will then record all request/response that the browser makes through that port...
To put it another way, let's forget about selenium and tests - If I manually set my Chrome browser to use a proxy server at localhost:8082, is there any way I can use mountebank to start a 'pass-through' proxy on that port that will record all requests/responses that occur when I then browse using Chrome?
I know mountebank can do a lot of great stuff, and I was really excited about the injection ability - perhaps my use case is actually too simplistic.
Thanks