本文整理汇总了Java中org.openqa.selenium.OutputType.convertFromBase64Png方法的典型用法代码示例。如果您正苦于以下问题:Java OutputType.convertFromBase64Png方法的具体用法?Java OutputType.convertFromBase64Png怎么用?Java OutputType.convertFromBase64Png使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openqa.selenium.OutputType
的用法示例。
在下文中一共展示了OutputType.convertFromBase64Png方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScreenshotAs
import org.openqa.selenium.OutputType; //导入方法依赖的package包/类
@Override
public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException {
Object takeScreenshot =
getCapabilities().getCapability(CapabilityType.TAKES_SCREENSHOT);
if (null == takeScreenshot || (Boolean) takeScreenshot) {
String base64Str = execute(DriverCommand.SCREENSHOT).getValue().toString();
return target.convertFromBase64Png(base64Str);
}
return null;
}
示例2: extractScreenShot
import org.openqa.selenium.OutputType; //导入方法依赖的package包/类
public <T> T extractScreenShot(WebDriverException e, OutputType<T> target) {
if (e.getCause() instanceof ScreenshotException) {
String base64Str = ((ScreenshotException) e.getCause()).getBase64EncodedScreenshot();
return target.convertFromBase64Png(base64Str);
}
return null;
}
示例3: getScreenshotAs
import org.openqa.selenium.OutputType; //导入方法依赖的package包/类
public <X> X getScreenshotAs(final OutputType<X> target) throws WebDriverException {
if ((Boolean) getCapabilities().getCapability(CapabilityType.TAKES_SCREENSHOT)) {
String output = execute(DriverCommand.SCREENSHOT).getValue().toString();
return target.convertFromBase64Png(output);
}
return null;
}
示例4: getScreenshotAs
import org.openqa.selenium.OutputType; //导入方法依赖的package包/类
@Override
public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException {
try {
if ((Boolean) getCapabilities().getCapability(CapabilityType.TAKES_SCREENSHOT)) {
String base64Str = execute(DriverCommand.SCREENSHOT).getValue().toString();
return target.convertFromBase64Png(base64Str);
}
return null;
} catch (Exception e) {
return null;
}
}
示例5: getScreenshotAs
import org.openqa.selenium.OutputType; //导入方法依赖的package包/类
@Override public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException {
// Get the screenshot as base64.
String base64 = (String) execute(DriverCommand.SCREENSHOT).getValue();
// ... and convert it.
return target.convertFromBase64Png(base64);
}