0

Hi I am new to Selendroid and was wondering if it was possible to launch Selendroid from a button inside the android app?
I am trying to create an onClick() event that implements Selendroid as follows in Java:

  public void onClick1(View view) throws InterruptedException {
    switch (view.getId()) {
            case R.id.button2:

        /*Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
        startActivity(browserIntent);*/
        SelendroidConfiguration config = new SelendroidConfiguration();

        selendroidServer = new SelendroidLauncher(config);
        selendroidServer.launchSelendroid();

        driver = new RemoteWebDriver(DesiredCapabilities.android());

        driver.get("http://www.nhl.com/ice/m_home.htm");
        Thread.sleep(5000);
        driver.findElement(By.cssSelector("#bodyWrap > a:nth-of-type("+2+") > div.playoffSeriesHeader > div > div > div > div ")).click();
    }
}
Chiquelo
  • 162
  • 2
  • 13

1 Answers1

0

If you ever come across this problem, one of the developers of Selendroid himself answered to the question here.

Chiquelo
  • 162
  • 2
  • 13