title: Error when adding selenium android driver jar in TestNG. Cannot find class file?
body: <p>I'm writing a test class for an Android App, but I keep getting the error code "The project was not built since its build path is incomplete. Cannot find the class file for org.openqa.selenium.html5.BrowserConnection. Fix the build path then try building this project." each time I try to add the selenium Android driver jar file to the project. I need the Android driver to use the TestNG with Appium properly, otherwise Appium can't find elements on the page when testing. The Code:</p>
  
  <pre><code>package appiumTest;
  
  import java.net.MalformedURLException;
  import java.net.URL;
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.android.*;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.remote.DesiredCapabilities;
  import org.openqa.selenium.remote.RemoteWebDriver;
  import org.testng.annotations.*;
  
  public class TestCase {
  
      public class NewTest {
          WebDriver driver = new AndroidDriver();
          @BeforeClass
          protected void setUp() throws MalformedURLException {
  
              //Tells the program what device is used
              DesiredCapabilities capabilities = new 
  
              DesiredCapabilities();
              capabilities.setCapability("BROWSER_NAME", "Android");
              capabilities.setCapability("VERSION", "4.2.2"); 
              capabilities.setCapability("deviceName","Emulator");
              capabilities.setCapability("platformName","Android");
              //Tells the program what app is being run
              capabilities.setCapability("appPackage",                                 
     "com.android.testapp2");
  
      capabilities.setCapability("appActivity",
     "com.android.testapp2.MainActivity    ");
       driver = (AndroidDriver) new RemoteWebDriver(new
               URL("http://127.0.0.1:4723/wd/hub"), capabilities);
          }
          @Test
          public void test() {
          WebElement userName = driver.findElement(By.id("txtUserName"));
                 userName.sendKeys("a");
              WebElement button = driver.findElement(By.id("btnEnter"));
      button.click();
          };
          @AfterClass
          protected void tearDown() throws Exception {
  
              driver.quit();
          }
  
      }
  
  
  }
  </code></pre>
  
  <p>Here's the code of the pom.xml file I'm trying to edit:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"        
  
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
  
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  
  http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;TestProject&lt;/groupId&gt;
    &lt;artifactId&gt;TestProject&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.3&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source/&gt;
            &lt;target/&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I don't see anywhere to put a dependency, and I'm not even sure if that's what I'm supposed to be doing.</p>