klov icon indicating copy to clipboard operation
klov copied to clipboard

image is not uploading on klov.

Open chetanJTH opened this issue 4 years ago • 6 comments

I am trying to attach image with klov using logger.addScreenCaptureFromPath(screenShot); but it gives error null pointer.

chetanJTH avatar Jul 02 '21 09:07 chetanJTH

  1. method is passed but it displays fail on the report.
  2. it displays some package name instead of showing an image of uploaded screenshot. image

chetanJTH avatar Jul 03 '21 05:07 chetanJTH

yes...for me its showing as fail but no image uploaded

prabhudatta22 avatar Aug 02 '21 15:08 prabhudatta22

@chetanJTH you can use

var media = MediaEntityBuilder.CreateScreenCaptureFromPath("imagePath","title");
extentTestNode.Log(Status.Pass,   media);

i will test logger.addScreenCaptureFromPath(screenShot);

namilkimfree avatar Aug 05 '21 16:08 namilkimfree

@chetanJTH : using the same. Still having problem. Though i am getting the screenshot attached in my extent Report locally created. But in KLOV server...its showing as blank. No screenshot attached.

prabhudatta22 avatar Aug 05 '21 16:08 prabhudatta22

@prabhudatta22 : that's what I am saying. I found another way to complete this.

>  try {
>                     File src = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
>                     byte[] fileContent = FileUtils.readFileToByteArray(src);
>                     String base64Screenshot = "data:image/png;base64," + Base64.getEncoder().encodeToString(fileContent);
>                     test.log(Status.FAIL, "Screenshot of failed test Case", test.addScreenCaptureFromBase64String(base64Screenshot).getModel().getMedia().get(0));
>                 } catch (Exception e) {
>                     test.fail("Test failed, cannot attach screenshot");
>                 }

If you give value 0 then it will upload two images and with value 1 it will upload single image. help me to resolve this with value 0 if possible.

@namilkimfree : thanks for help

chetanJTH avatar Aug 06 '21 03:08 chetanJTH

@namilkimfree have you tested this : logger.addScreenCaptureFromPath(screenShot);

chetanJTH avatar Nov 17 '21 03:11 chetanJTH