如何使用.net客户端将文件/图片发送到Report Portal?

时间:2016-12-20 14:06:16

标签: reportportal

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

1 个答案:

答案 0 :(得分:1)

示例在Tests项目中。

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

相关文档:Log Data in ReportPortal