title: Automating the mobile browser on Android with Appium
body: <p>I am writing a simple test to navigate to a website on a mobile browser, mostly to get an understanding of Appium. I am using an android emulator. My code looks like this: </p>
  
  <pre><code>import io.appium.java_client.android.AndroidDriver;
  import io.appium.java_client.remote.MobileBrowserType;
  import org.junit.Test;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.remote.DesiredCapabilities;
  import java.net.URL;
  
  public class DLMobileTest
  {
      private WebDriver driver;
  
      @Test
      public void loadingSinglePageTest() throws Exception{
          DesiredCapabilities capabilities = new DesiredCapabilities();
          capabilities.setCapability("platformName", "Android");
          capabilities.setCapability("platformVersion", "5.0.1");
          capabilities.setCapability("deviceName", "Nexus 7");
          capabilities.setCapability("browserName", MobileBrowserType.BROWSER);
          driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
          driver.get("http://en.wikipedia.org");
          driver.quit();
      }
  }
  </code></pre>
  
  <p>When I run the test, the emulator's browser briefly starts, but before it navigates to the Wikipedia site I'm aiming for, I get this: </p>
  
  <pre><code>org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Did not get session redirect from Chromedriver) (WARNING: The server did not provide any stacktrace information)
  </code></pre>
  
  <p>I'm not sure what my mistake is here. Any help is appreciated. </p>