How can I send files / pictures to Report Portal with .net client?

2.9k Views Asked by At

I'd like to send a binary attachment to Report Portal with .net client. How can I do it?

1

There are 1 best solutions below

0
On BEST ANSWER

Example is in Tests project.

https://github.com/reportportal/client-net/blob/master/ReportPortal.Client.Tests/LogItem/LogItem.cs

Find CreateLogWithAttach test and see code.

var data = new byte[] { 1, 2, 3 };
            var log = Service.AddLogItem(new AddLogItemRequest
            {
                TestItemId = _testId,
                Text = "Log1",
                Time = DateTime.UtcNow,
                Level = LogLevel.Info,
                Attach = new Attach("file1", "application/octet-stream", data)
            });

Related documentation: Log Data in ReportPortal