First, a javascript code layer will appear, which is used to automate the browser and simulate events, run and test tests. Then you start the proxy server that your browser points to - which injects this javascript code. Then you can talk to this proxy server through a different port using a set of commands that forces the proxy server to enter javascript code to launch (or remotely control) a working browser. Using this structure, you can write automated test scripts in a style very similar to writing macros for the browser.