Nunit 3和Selenium C#的报告工具 [英] Reporting tool for Nunit 3 and Selenium C#

查看:150
本文介绍了Nunit 3和Selenium C#的报告工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Selenium与C#结合使用来创建自动化测试.现在,我必须使用某种报告工具来保存测试用例是否通过,失败...等.

I'm using Selenium with C# to create my automated tests. Now i have to use some sort of reporting tools to save the test cases whether they passed,failed...etc.

我看过很多工具,例如Allure和Jenkins.但是它们需要一个XML文件.使用Visual 2013运行测试时找不到它.为什么?

I've seen a lot of tools like Allure, and Jenkins. But they require an XML file. and i can't find it when i run my tests using Visual 2013. Why is that ?

如果我缺少某些内容,如何获取这些XML文件的详细信息?

我有什么办法可以用最少的努力做到这一点?

Is there any way i could achieve this with minimum effort ?

如何使用Nunit控制台运行程序运行测试?我在哪里可以找到它?我为nunit下载了.zip,但找不到跑步者?

How can i run my tests using Nunit console runner ? where can i find it? i downloaded the .zip for nunit but i couldn't find the runner?

推荐答案

尽管存在

The NUnit Visual Studio Adapter does not currently produce XML results, although there is an issue on GitHub to add the ability. Your best bet is to run your tests using the NUnit Console runner when you want to create reports. It always produces an XML result file.

您可以通过添加 NUnit.Console NuGet软件包来安装NUnit控制台.您的测试项目.控制台将位于解决方案根目录中的packages\NUnit.ConsoleRunner.3.4.0\tools之类的目录中.

You can install the NUnit Console by adding the NUnit.Console NuGet package to your test project. The console will be in a directory like packages\NUnit.ConsoleRunner.3.4.0\tools in your solution root.

另一种选择是为控制台运行程序安装 MSI .然后它将在C:\Program Files (x86)\NUnit.org\nunit-console

Another option is to install the MSI for the console runner. It will then be under C:\Program Files (x86)\NUnit.org\nunit-console

要创建报告,请 ReportUnit 从测试结果中创建出色的HTML报告.

For creating reports, ReportUnit creates excellent HTML reports from your test results.

要运行测试,我建议设置一个简单的命令行版本,以构建您的解决方案,运行测试,然后生成报告.对于日常开发,仅在Visual Studio或命令行中运行测试就足够了.大多数开发人员发现Visual Studio测试资源管理器"窗口的UI较差,但是可用于查看通过和失败的测试以及运行/调试它们.

To run the tests, I would recommend setting up a simple command line build that builds your solution, runs the tests and then produces the report. For day to day development, just running your tests in Visual Studio or on the command line will likely be enough. Most developers find the Visual Studio Test Explorer Window to be a poor UI, but usable for seeing passed and failed tests and running/debugging them.

如果要设置命令行构建,蛋糕构建是一个不错的工具.设置会花费一些时间,但是当项目变大时,这是运行构建任务的绝佳方法.

If you want to setup a command line build, one good tool is Cake Build. It will take a bit of time to setup, but it is an excellent way to run your build tasks as your project gets larger.

这篇关于Nunit 3和Selenium C#的报告工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆