0

I am currently starting automated testing in robot framework. As part of this I need to go to a demo page and click on a button. The click event triggers a network request to our server which returns whether or not agents are available. I need a way of intercepting or mocking the response and putting it in place of what is passed back from the server. I have a flask endpoint that I've set up going to the same location as the server and I'm returning a correct response, but I don't know how I go about patching that "mock" response in place of what is on the browser session. Any help would be appreciated.

I have set up a flask endpoint which returns the correct response, but haven't been able to figure out how I'm supposed to put that in place of the response in the browser. I've tried looking at using mock server, but it was deemed overly complicated for what I was trying to do with it by the other devs. I have checked several different locations but I don't even know if I'm asking the right questions here, I just know that everything I have tried for the past week has resulted in me having got nowhere

  • Questions like this are actually answered with another one - "how do I do that manually?" If you have the answer to that, doing it in RF is just mechanical implementation of that algorithm. So - do you know how to do it manually? :) By the tone I guess no, thus a couple of suggestions - a) have an http reverse proxy (nginx, for example) that forwards everything to the normal app, except that endpoint - which goes to your mock service. Option b) modify (through js) the listener on that button, so its target handler/service is your mock one. – Todor Minakov Mar 18 '23 at 09:34

0 Answers0