I'm running a test using Selenium Webdriver (Java) and half way through the test I want to set my browser to offline, execute a couple of steps and turn the browser connection on again. Is there an easy way to do this, or maybe change the browser proxy to an non existent one (emulate offline) and set back to something valid again? I need to keep browser cache, browser local storage area and browser cookies between online, offline and online again.
Thanks