Package org.openqa.selenium.android

Examples of org.openqa.selenium.android.AndroidDriver


     *
     * @see org.jboss.arquillian.drone.spi.Instantiator#createInstance(org.jboss.arquillian.drone.spi.DroneConfiguration)
     */
    @Override
    public AndroidDriver createInstance(TypedWebDriverConfiguration<AndroidDriverConfiguration> configuration) {
        AndroidDriver driver = super.createInstance(configuration);
        AndroidDriver proxy = GrapheneContext.getProxyForDriver(AndroidDriver.class);
        GrapheneContext.set(driver);
        return proxy;
    }
View Full Code Here


        browser = WebDriverBackedEmbeddedBrowser.withRemoteDriver(configuration
                .getBrowserConfig().getRemoteHubUrl(), filterAttributes, crawlWaitEvent,
                crawlWaitReload);
        break;
      case ANDROID:
        browser = WebDriverBackedEmbeddedBrowser.withDriver(new AndroidDriver(),
                filterAttributes, crawlWaitEvent, crawlWaitReload);
        break;

      default:
        throw new IllegalStateException("Unrecognized browsertype "
View Full Code Here

                        .getBrowserConfig().getRemoteHubUrl(), filterAttributes,
                        crawlWaitEvent, crawlWaitReload);
        break;
      case ANDROID:
        browser =
                WebDriverBackedEmbeddedBrowser.withDriver(new AndroidDriver(),
                        filterAttributes, crawlWaitEvent, crawlWaitReload);
        break;

      case PHANTOMJS:
        browser = newPhantomJSDriver(filterAttributes, crawlWaitReload, crawlWaitEvent);
View Full Code Here

    }

    @Override
    protected AndroidDriver createBrowser() {
        try {
            return new AndroidDriver(new URL(getAndroidDriverUrl()), createCapabilities());
        } catch (MalformedURLException e) {
            LOGGER.error("MalformedURLException thrown for invalid URL: " + getAndroidDriverUrl());
            return null;
        }
    }
View Full Code Here

        assertThat(deserializedConfig, is(config));
    }

    @Test
    public void shouldCreateAndroidDriver() throws Exception {
        AndroidDriver mockAndroidDriver = Mockito.mock(AndroidDriver.class);
        whenNew(AndroidDriver.class).withParameterTypes(URL.class, DesiredCapabilities.class).withArguments(isA(URL.class), isA(DesiredCapabilities.class)).thenReturn(mockAndroidDriver);

        final AndroidDriver browser = config.createBrowser();

        assertThat(browser, is(mockAndroidDriver));
        verifyNew(AndroidDriver.class, times(1)).withArguments(isA(URL.class), isA(DesiredCapabilities.class));
    }
View Full Code Here

    @Test
    public void shouldHandleInvalidUrl() throws Exception {
        whenNew(AndroidDriver.class).withParameterTypes(URL.class, DesiredCapabilities.class).withArguments(isA(URL.class), isA(DesiredCapabilities.class)).thenThrow(new MalformedURLException("testing123"));

        final AndroidDriver browser = config.createBrowser();
        assertNull(browser);
    }
View Full Code Here

    protected WebDriver createAndroidDriver() {
        try {
            String url = System.getProperty("webdriver.android.url", "http://localhost:8080/hub");
            ScreenOrientation screenOrientation = ScreenOrientation.valueOf(System.getProperty(
                    "webdriver.android.screenOrientation", "portrait").toUpperCase(usingLocale()));
            AndroidDriver driver = new AndroidDriver(url);
            driver.rotate(screenOrientation);
            return driver;
        } catch (MalformedURLException e) {
            throw new UnsupportedOperationException(e);
        }
    }
View Full Code Here

        break;
      case htmlunit:
        browser = newHtmlUnitBrowser(filterAttributes, crawlWaitReload, crawlWaitEvent);
        break;
      case android:
        browser = WebDriverBackedEmbeddedBrowser.withDriver(new AndroidDriver(),
                filterAttributes, crawlWaitEvent, crawlWaitReload);
        break;

      case iphone:
        try {
View Full Code Here

        } catch (Exception e) {
          LOGGER.error(e.getMessage(), e);
        }

      case android:
        return WebDriverBackedEmbeddedBrowser.withDriver(new AndroidDriver(),
                configuration.getFilterAttributeNames(), configuration
                        .getCrawlSpecificationReader().getWaitAfterEvent(), configuration
                        .getCrawlSpecificationReader().getWaitAfterReloadUrl());

      default:
View Full Code Here

                        .getBrowserConfig().getRemoteHubUrl(), filterAttributes,
                        crawlWaitEvent, crawlWaitReload);
        break;
      case ANDROID:
        browser =
                WebDriverBackedEmbeddedBrowser.withDriver(new AndroidDriver(),
                        filterAttributes, crawlWaitEvent, crawlWaitReload);
        break;

      case PHANTOMJS:
        browser = newPhantomJSDriver(filterAttributes, crawlWaitReload, crawlWaitEvent);
View Full Code Here

TOP

Related Classes of org.openqa.selenium.android.AndroidDriver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.