1

我想使用.net client向Report Portal发送二进制附件。我该怎么做?

4

1 回答 1

2

示例在测试项目中。

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

查找CreateLogWithAttach测试并查看代码。

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)
            });

相关文档:ReportPortal 中的日志数据

于 2016-12-20T14:06:16.143 回答