项目中使用截图和邮件的方法
try{
xxxxxxxxxxxxxxxxxx
} catch (Exception e) {
if (FlagEnum.MAIL_FLAG.getFlag()) {
String tpath = "D:/screen/" + PubModule.screenshot(driver) + ".png";
Mail.sendEmailAttach(ConstantEnum.ERROR_MESSAGE.getValue() + "xxxxxx", e.getLocalizedMessage().replaceAll("\\s*", ""), tpath);
} else {
e.printStackTrace();
}
}