examples-java
examples-java copied to clipboard
Unable to send attachment to ReportPortal
Describe the bug I am unable to send scrrenshotOnFailure as an attachment to Report Portal.
Steps to Reproduce Steps to reproduce the behavior:
- Logger used to send attachment to reportPortal : public static final Logger logger = LoggerFactory.getLogger("binary_data_logger");
- We are sending compressed file as, reportportal doesn't support file greater than specific size.
- 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
Additional context
Log4j2.xml configuration as below:
@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:
- Provide Log4j2.xml config and Log4j2 dependencies, which you use.
- Check out our examples:
- An example test: https://github.com/reportportal/examples-java/blob/master/example-testng-log4j/src/main/java/com/epam/reportportal/example/testng/log4j/extension/ScreenshotOnFailureTestExtensionTest.java
- Log4j2 configuration: https://github.com/reportportal/examples-java/blob/master/example-testng-log4j/src/main/resources/log4j2.xml
- Dependencies: https://github.com/reportportal/examples-java/blob/master/example-testng-log4j/pom.xml#L43-L58
Abandoned