title: Can I run multiple instances at once(simultaneously) with selenium-webdriver?
body: <p>I'm trying to use Selenium to automate file uploading.</p>
  
  <p>I'v already wrote a tiny program with the <a href="https://seleniumhq.github.io/selenium/docs/api/javascript/" rel="noreferrer">selenium-webdriver</a> that works.</p>
  
  <p>The problem is, there are thousands of files need to be uploaded, I'd like to run multiple browser instances simultaneously to speed up the automation. So I tried something like this</p>
  
  <pre><code>var i = 0;
  while (i &lt; 10) {
      i++;
      var driver = new webdriver.Builder()
              .forBrowser('firefox')
              .build();
  
      // login and upload files......
  }
  </code></pre>
  
  <p>I expected this would create 10 browser instances at once, and do the automation simultaneously.</p>
  
  <p>But actually... the above code will creates browser instance 'one by one' which means, it won't create another instance until the previous one finishes.</p>
  
  <p>I'v also tried execute the program in multiple shell instances, that will fire up multiple browser instances for me, but I just don't want to do this...</p>