org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs方法的一些代码示例,展示了RemoteWebDriver.getScreenshotAs的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteWebDriver.getScreenshotAs方法的具体详情如下:
包路径:org.openqa.selenium.remote.RemoteWebDriver
类名称:RemoteWebDriver
方法名:getScreenshotAs

RemoteWebDriver.getScreenshotAs介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.che.selenium/che-selenium-core

@Override
public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException {
 return driver.getScreenshotAs(target);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui

@Override
public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException
{
  return this.wrappedDriver.getScreenshotAs(outputType);
}

代码示例来源:origin: org.mycore/selenium-utils

public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException {
  return delegate.getScreenshotAs(outputType);
}

代码示例来源:origin: te-con/ehour

public void captureScreenshot(String fileName) {
    try {
      new File("target/surefire-reports/").mkdirs();
      FileOutputStream out = new FileOutputStream("target/surefire-reports/screenshot-" + fileName + ".png");
      out.write(driver.getScreenshotAs(OutputType.BYTES));
      out.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
};

代码示例来源:origin: com.github.becausetesting/commons

byte[] screenshotAs = SeleniumCore.driver.getScreenshotAs(OutputType.BYTES);
FileOutputStream fileOutputStream = null;
try {

代码示例来源:origin: com.applitools/eyes-selenium-java3

public <X> X getScreenshotAs(OutputType<X> xOutputType)
    throws WebDriverException {
  // Get the image as base64.
  String screenshot64 = driver.getScreenshotAs(OutputType.BASE64);
  BufferedImage screenshot = ImageUtils.imageFromBase64(screenshot64);
  screenshot = normalizeRotation(logger, driver, screenshot, rotation);
  // Return the image in the requested format.
  screenshot64 = ImageUtils.base64FromImage(screenshot);
  return xOutputType.convertFromBase64Png(screenshot64);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

byte[] screenshotAs = SeleniumCore.driver.getScreenshotAs(OutputType.BYTES);
FileOutputStream fileOutputStream = null;
try {

代码示例来源:origin: com.github.becausetesting/commons

String platform = "Platform: " + capabilities.getBrowserName() + ","
    + capabilities.getPlatform().name();
screenshotAs = remoteWebDriver.getScreenshotAs(OutputType.BYTES);

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

String platform = "Platform: " + capabilities.getBrowserName() + ","
    + capabilities.getPlatform().name();
screenshotAs = remoteWebDriver.getScreenshotAs(OutputType.BYTES);

相关文章