Package org.openqa.selenium.remote

Examples of org.openqa.selenium.remote.Augmenter


        cap.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
        cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
        try {
          webDriver = new RemoteWebDriver(new URL(
              System.getProperty(SELENIUM_HUB)), cap);
          webDriver = new Augmenter().augment(webDriver);
        } catch (MalformedURLException e) {
          throw new RuntimeException(e);
        }

      }
View Full Code Here


    private WebDriver getTakingScreenshotsBrowser() {
        WebDriver result = ((GrapheneProxyInstance) (GrapheneContext.getContextFor(Default.class)
            .getWebDriver(TakesScreenshot.class))).unwrap();
        if (result instanceof ReusableRemoteWebDriver) {
            result = new Augmenter().augment(result);
        }
        return result;
    }
View Full Code Here

  /**
   * Add all the IOS specific interfaces ios-driver supports.
   */
  public static <T> T augment(WebDriver driver) {
    Augmenter augmenter = new Augmenter();
    augmenter.addDriverAugmentation(IOSCapabilities.CONFIGURABLE, new AddConfigurable());
    augmenter.addDriverAugmentation(IOSCapabilities.ELEMENT_TREE, new AddLogElementTree());
    augmenter.addDriverAugmentation(IOSCapabilities.IOS_SEARCH_CONTEXT, new AddIOSSearchContext());
    augmenter.addDriverAugmentation(IOSCapabilities.IOS_TOUCH_SCREEN, new AddIOSTouchScreen());
    return (T) augmenter.augment(driver);
  }
View Full Code Here

    if (webdriver instanceof TakesScreenshot) {
      targetFile = takeScreenshotImage((TakesScreenshot) webdriver, fileName, targetFile);
    }
    else if (webdriver instanceof RemoteWebDriver) {
      WebDriver remoteDriver = new Augmenter().augment(webdriver);
      if (remoteDriver instanceof TakesScreenshot) {
        targetFile = takeScreenshotImage((TakesScreenshot) remoteDriver, fileName, targetFile);
      }
    }
View Full Code Here

    if (driver instanceof TakesScreenshot) {
      T screenshot = ((TakesScreenshot) driver).getScreenshotAs(outType);
      removeCanvasGeneratedByFirefoxDriverForScreenshots();
      return screenshot;
    } else if (driver instanceof RemoteWebDriver) {
      WebDriver augmentedWebdriver = new Augmenter().augment(driver);
      return takeScreenShotOnBrowser(augmentedWebdriver, outType);
    } else if (driver instanceof WrapsDriver) {
      return takeScreenShotOnBrowser(((WrapsDriver) driver).getWrappedDriver(), outType);
    } else {
      throw new CrawljaxException("Your current WebDriver doesn't support screenshots.");
View Full Code Here

  protected File savePageImageToFile(String fileName, WebDriver webdriver) {
    File imageFile = null;
    if (webdriver instanceof TakesScreenshot) {
      imageFile = takeScreenshotImage((TakesScreenshot) webdriver, fileName);
    } else if (webdriver instanceof RemoteWebDriver) {
      WebDriver remoteDriver = new Augmenter().augment(webdriver);
      if (remoteDriver instanceof TakesScreenshot) {
        imageFile = takeScreenshotImage((TakesScreenshot) remoteDriver, fileName);
      }
    }
    return imageFile;
View Full Code Here

    if (driver instanceof TakesScreenshot) {
      T screenshot = ((TakesScreenshot) driver).getScreenshotAs(outType);
      removeCanvasGeneratedByFirefoxDriverForScreenshots();
      return screenshot;
    } else if (driver instanceof RemoteWebDriver) {
      WebDriver augmentedWebdriver = new Augmenter().augment(driver);
      return takeScreenShotOnBrowser(augmentedWebdriver, outType);
    } else if (driver instanceof WrapsDriver) {
      return takeScreenShotOnBrowser(((WrapsDriver) driver).getWrappedDriver(), outType);
    } else {
      throw new CrawljaxException("Your current WebDriver doesn't support screenshots.");
View Full Code Here

  @Test(enabled = false)
  public void testShouldSetAndGetLocation() {
    //driver.get(pages.html5Page);

    LocationContext d = (LocationContext) new Augmenter().augment(driver);
    Location loc = new Location(40.714353, -74.005973, 0.056747);

    d.setLocation(loc);

    //driver.manage().timeouts().implicitlyWait(2000, MILLISECONDS);
View Full Code Here

  }
   
  @Test
  public void canSetAndGetOrientationUsingTheWebDriverAPI() throws MalformedURLException {
    driver = new RemoteIOSDriver(getRemoteURL(), IOSCapabilities.iphone("Safari"));
    WebDriver d = new Augmenter().augment(driver);
    Rotatable rotator = ((Rotatable) d);
    rotator.rotate(LANDSCAPE);
    Assert.assertEquals(rotator.getOrientation(), LANDSCAPE);
    rotator.rotate(PORTRAIT);
    Assert.assertEquals(rotator.getOrientation(), PORTRAIT);
View Full Code Here

  }

  @Test(expectedExceptions = WebDriverException.class)
  public void detectUnsupportedOrientationWithTheWebDriverAPI() throws MalformedURLException {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    WebDriver d = new Augmenter().augment(driver);
    Rotatable rotator = ((Rotatable) d);
    Assert.assertEquals(rotator.getOrientation(), PORTRAIT);
    rotator.rotate(LANDSCAPE);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.remote.Augmenter

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.