Olá, preciso da seguinte ajuda: Ao rodar o meu teste automatizado e o mesmo apresenta falha, o arquivo html de erro gerado pelo método abaixo, é gerado em branco. Quando o teste verifica alguma string, não acha pois o código html está vazio. Alguém já vivenciou esse problema???
É aqui mesmo que eu posto este assunto?
Obrigada
protected String geraArquivoErro() {
LOG.info(“Gerando arquivo de erro”);
try {
long timemillis = System.currentTimeMillis();
File file = new File(“src/test/resources/funcional/errowebtest/”);
String filename = “erro” + timemillis + “.html”;
if (!file.exists())
file.mkdirs();
if (file.canWrite()) {
FileOutputStream f = new FileOutputStream(new File(file,
filename), false);
f.write(getTestContext().getWebClient().getCurrentPage()
.getText().getBytes());
f.close();
}
return filename;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}