Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

Can Selenium test an application on Android browser

Selenium should be able to handle Android browser. There is a Selenium Android Driver for running tests in Android browser.

You can use Selendroid or Appium framework to test native apps or web apps in Android browser.

Here is some code sample for it.

@BeforeClass
  public static void startSelendroidServer() throws Exception {
    if (selendroidServer != null) {
      selendroidServer.stopSelendroid();
    }
    SelendroidConfiguration config = new SelendroidConfiguration();
    config.addSupportedApp("selendroid-test-app-0.9.0.apk");
    selendroidServer = new SelendroidLauncher(config);
    selendroidServer.lauchSelendroid();

    SelendroidCapabilities caps =
        new SelendroidCapabilities("io.selendroid.testapp:0.9.0");

    driver = new SelendroidDriver(caps);
  }