Examples of Augmenter


Examples of org.openqa.selenium.remote.Augmenter

    File to = new File("ss.png");
    to.delete();

    Assert.assertFalse(to.exists());

    WebDriver screenshotter = new Augmenter().augment(driver);
    to = ((TakesScreenshot) screenshotter).getScreenshotAs(OutputType.FILE);
    Assert.assertTrue(to.exists());
  }
View Full Code Here

Examples of org.openqa.selenium.remote.Augmenter

             * @throws MalformedURLException
             */
            public void setRemoteDriver(String url) throws MalformedURLException {
                this.driver = new RemoteWebDriver(new URL(url),capabilities);
                setJSDriver();
                this.driver = new Augmenter().augment(this.driver);
                this.driver.manage().timeouts().pageLoadTimeout(MAX_WAIT_S, TimeUnit.SECONDS);
                this.driver.manage().timeouts().implicitlyWait(MAX_WAIT_S, TimeUnit.SECONDS);
            }
View Full Code Here

Examples of org.openqa.selenium.remote.Augmenter

        }
       
        try {
           
            WebDriver driver = new RemoteWebDriver(new URL(gridUrl), desiredCapabilities);
            WebDriver augmentedDriver = new Augmenter().augment(driver);
          return new SeleniumBrowser(augmentedDriver);
        }
        catch (Exception ex) {
          throw new RuntimeException(ex);
        }
View Full Code Here

Examples of org.openqa.selenium.remote.Augmenter

    private TakesScreenshot getTakesScreenshot() {
        if (driver instanceof TakesScreenshot) {
            return (TakesScreenshot) driver;
        } else if (driver instanceof RemoteWebDriver && ((HasCapabilities) driver).getCapabilities().is(TAKES_SCREENSHOT)) {
            return (TakesScreenshot) new Augmenter().augment(driver);
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.openqa.selenium.remote.Augmenter

    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

Examples of org.openqa.selenium.remote.Augmenter

  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

Examples of org.openqa.selenium.remote.Augmenter

    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

Examples of org.openqa.selenium.remote.Augmenter

        throw new CrawljaxException(e);
      }

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

Examples of org.openqa.selenium.remote.Augmenter

   *
   * @return a fresh RemoteWebDriver instance
   * @throws RuntimeException in case of any error
   */
  public WebDriver get() {
    return new Augmenter().augment(new RemoteWebDriver(getRemote(), getCapabilities()));
  }
View Full Code Here

Examples of org.openqa.selenium.remote.Augmenter

        graphics.drawRect(x, y, width, height);
    }

    private File createTempScreenshotFile() throws IOException {
        try {
            driver = new Augmenter().augment(driver);
        } catch (Exception ignored) {
        }
        File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);

        File renamedFile = new File(System.getProperty("java.io.tmpdir"), new Date().getTime() + ".png");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.