title: Does Selenium WebDriver Open Multiple Tabs Synchronously or Asynchronously?
body: <p>I'm using <code>Selenium WebDriver</code> with <code>Firefox</code> to navigate to a list of URLs. Currently, <code>WebDriver</code> is set to open a max of 50 tabs per browser. I'm using a proxy service that allows a max of 1 thread to be used at a time per IP. In other words, they do not allow parallel (or asynchronous) requests only synchronous requests.</p>
  
  <p>I am under the impression that if I execute the following code:</p>
  
  <pre><code>navigateToURL(driver, subListOfURLs.get(0));
  
  for (int counter = 1; counter &lt; subListOfURLs.size(); counter++) {
          String url = subListOfURLs.get(counter);
          ((JavascriptExecutor) driver).executeScript("window.open(arguments[0])", url);
  }
  
  Set&lt;String&gt; windowHandles = driver.getWindowHandles();
  
  for (String window : windowHandles) {
  
          driver.switchTo().window(window.toString());
  
          // do something with each tab
  }
  </code></pre>
  
  <p>that regardless of the number of tabs being opened, each tab will be opened synchronously (one after the other) since the call to:</p>
  
  <pre><code>    ((JavascriptExecutor)driver).executeScript("window.open(arguments[0])", url);
  </code></pre>
  
  <p>will always run asynchronously  (with the explicit exception if the entire code above is multi-threaded which is not the case)</p>
  
  <p>Can I be confident that Firefox will not send two requests to proxy server synchronously?</p>