title: How to run Selenium tests in multiple browsers for cross-browser testing using Java?
body: <p>I am using Selenium WebDriver with Java &amp; TestNG framework. I want to use Firefox, IE, Chrome in one single code at a time for doing cross-browser testing. I can only initialize Firefox as</p>
  
  <pre><code>driver = new FirefoxDriver();
  </code></pre>
  
  <p>but cannot initialize other browsers in the same way. For example:</p>
  
  <pre><code>driver = new InternetExplorerDriver();
  </code></pre>
  
  <p>gives the error <code>InternetExplorerDriver cannot be resolved.</code></p>
  
  <pre><code>driver = new ChromeDriver();
  </code></pre>
  
  <p>gives the error <code>ChromeDriver cannot be resolved.</code></p>
  
  <p>How can I initialize IE and Chrome and execute my tests in all the desired browser ?</p>