NUnit测试的其他日志输出失败

编程入门 行业动态 更新时间:2024-10-16 16:36:36
本文介绍了NUnit测试的其他日志输出失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

每当NUnit测试在执行期间失败(即不使用 Assert。* )时,我想记录附加信息(I'如何在NUnit中指定一个全局异常处理程序,它能够在网页的当前DOM上记录附加信息。

Whenever an NUnit test fails during its execution (i.e. not when using Assert.*), I want to log additional information (I'm writing web tests and I am especially interested in the web page's current DOM).

code> NoSuchElementException s - 测试仍然会失败。

How to specify a global exception handler in NUnit which is able to log additional information on NoSuchElementExceptions - test should still fail of course.

推荐答案

你可以写一个记录信息的NUnit事件监听器插件。请参阅 www.nunit/index.php? p = nunitAddins& r = 2.6.3 和 http ://www.nunit/index.php p =事件侦听&安培; R = 2.6.3 ?。有关教程,请参阅 https:// www.simple-talk/dotnet/-tools/testing-times-ahead-extending-nunit/ 。

You could write an NUnit event listener addin that logs the information. See www.nunit/index.php?p=nunitAddins&r=2.6.3 and www.nunit/index.php?p=eventListeners&r=2.6.3. For a tutorial, see www.simple-talk/dotnet/-tools/testing-times-ahead-extending-nunit/.

更多推荐

NUnit测试的其他日志输出失败

本文发布于:2023-11-06 23:58:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565011.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:测试   日志   NUnit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!