title: Timed out receiving message from renderer: 300.000 error while switching between windows using ChromeDriver and Chrome through Selenium and Java
body: <p>I have a problem with selenium 3.13.0 and chrome version 79.0.3945.130 and java. I wrote this code for testing a web page that has to switch between 2 windows. when I start running this script everything is OK, but when the driver switches to the new window, It seems no longer available! And after a long time, I got this error.
  Does anyone know where the problem is?</p>
  
  <p>(I'm sure the control of the program will come out of the loop and switch to the new window but it seems to the driver will be lost after leaving the loop. )</p>
  
  <p>some functions like driver.quit() or driver.getWindowHandles() worked after exiting the loop but some others like driver.getPageSource() or driver.manage().window().maximize() are not working and cause this Error.</p>
  
  <p>Here's my sample code:</p>
  
  <pre><code>public class myClassFirst {
  
  public static void main(String[] args) throws InterruptedException {
      System.setProperty("webdriver.chrome.driver","Driver_Path");
      WebDriver driver = new ChromeDriver();
      driver.manage().window().maximize();      //it works correctly
      driver.get("Web_page_Url");
      Thread.sleep(15000);  //to load page
      System.out.println("finish waiting ...");
      /*
          some script here
      */
      // go to appropriate frame
      driver.switchTo().defaultContent();
      driver.switchTo().frame("Faci3");
      driver.switchTo().frame(driver.findElement(By.name("Commander")));
      Set&lt;String&gt; s = driver.getWindowHandles();
      System.out.println(s);  //print windowID of current window(1)
      //select button element
      WebElement prepareToPrint = driver.findElement(By.id("PreparePrint"));
      prepareToPrint.click();
      Thread.sleep(5000);  //to load new window(2)
      String sThis = driver.getWindowHandle();   //get windowID of current window(1)
      for (String winId:driver.getWindowHandles()) {
          if (!winId.equals(sThis)) {
              driver.switchTo().window(winId);   //switch to new window(2)
              System.out.println(winId);          //print windowID of new window(2)
              break;
          }
      }
      System.out.println("exit from the loop");
      driver.manage().window().maximize();  //From here does not work anymore(real line 92)
      Actions builder = new Actions(driver);
      builder.contextClick().perform();
      System.out.println("End = Finish");
      driver.quit();
  }
  }
  </code></pre>
  
  <p>and this is the output:</p>
  
  <pre><code>finish waiting ...
  [CDwindow-9B003436EA7F9E41C56694893D686231]
  CDwindow-7205BC1AD0022BD28BFD18FCD4FA379B
  exit from the loop
  [1579772104.277][SEVERE]: Timed out receiving message from renderer: 300.000
  [1579772104.280][SEVERE]: Timed out receiving message from renderer: -0.003
  Exception in thread "main" org.openqa.selenium.TimeoutException: timeout
    (Session info: chrome=79.0.3945.130)
  Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:14.902Z'
  System info: host: 'DESKTOP-BT6SU1U', ip: '192.168.67.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
  Driver info: org.openqa.selenium.chrome.ChromeDriver
  Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 79.0.3945.130, chrome: {chromedriverVersion: 79.0.3945.36 (3582db32b3389..., userDataDir: C:\Users\Sadell\AppData\Loc...}, goog:chromeOptions: {debuggerAddress: localhost:61628}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
  Session ID: 5b36cc7b69534ede85d7c957306c2626
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
      at org.openqa.selenium.remote.RemoteWebDriver.perform(RemoteWebDriver.java:614)
      at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:638)
      at org.openqa.selenium.interactions.Actions.perform(Actions.java:594)
      at myClassFirst.main(myClassFirst.java:92)
  
  Process finished with exit code 1
  </code></pre>