reportportal / examples-java

Java examples of Report Portal usage
https://reportportal.io/
Apache License 2.0
17 stars 54 forks source link

Unable to send attachment to ReportPortal #75

Open bhagyaISS opened 1 year ago

bhagyaISS commented 1 year ago

Describe the bug I am unable to send scrrenshotOnFailure as an attachment to Report Portal.

Steps to Reproduce Steps to reproduce the behavior:

  1. Logger used to send attachment to reportPortal : public static final Logger logger = LoggerFactory.getLogger("binary_data_logger");
  2. We are sending compressed file as, reportportal doesn't support file greater than specific size.
  3. Code snippet: String screenShotFilePathCompressed = attachments.get(1); try { logger.info("RP_MESSAGE#FILE#{}#{}", screenShotFilePathCompressed, "Attachment"); logger.info("File Location : " + screenShotFilePath); } catch (Exception e) { logger.info("Test failed, cannot attach screenshot"); }

Expected behavior To log screenshot as attachment into report portal

Actual behavior Screenshot not attached.

Dependency versions Include version info of the following libraries: selenium-java: 3.141.59 Java:11

com.epam.reportportal agent-java-testng 5.1.0 com.epam.reportportal logger-java-log4j 5.1.8 org.apache.logging.log4j log4j-api 2.20.0 org.apache.logging.log4j log4j-core 2.20.0

Additional context

Log4j2.xml configuration as below:

<?xml version="1.0" encoding="UTF-8"?>

HardNorth commented 6 months ago

@bhagyaISS You didn't provide any Log4j configuration actually. And I recently updated and tested Log4j integration on our examples, it is working. So, please do the following things:

  1. Provide Log4j2.xml config and Log4j2 dependencies, which you use.
  2. Check out our examples: