Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image is not uploading on klov. #80

Open
chetanJTH opened this issue Jul 2, 2021 · 6 comments
Open

image is not uploading on klov. #80

chetanJTH opened this issue Jul 2, 2021 · 6 comments

Comments

@chetanJTH
Copy link

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

@chetanJTH
Copy link
Author

  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

@prabhudatta22
Copy link

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

@namilkimfree
Copy link

@chetanJTH
you can use

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

i will test logger.addScreenCaptureFromPath(screenShot);

@prabhudatta22
Copy link

@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.

@chetanJTH
Copy link
Author

chetanJTH commented Aug 6, 2021

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants