I have an instance whereby the page I'm navigating to never fully loads in the test environments although all GUI elements are visible, this is as a result of a keepalive.php script which keeps the connection open to Google Analytics and other analytical scripts within the code awaiting the sending and receiving of information. As we don't collect the statistics within the network, the script never finishes and the page never fully loads.
When navigating to the page manually, pressing Escape stops the script from running and loads the page therefore I tried using the Selenium Actions:
Actions action = new Actions(driver);
action.SendKeys(Keys.Escape);
However, I believe this code is never reached, as Selenium is waiting for the page to fully load before executing any further lines of code.
Unfortunately removing or altering the keepalive.php and google analytics code within our test environments is not a viable option, rather our automation suite must work around this.