简体   繁体   English

在 Azure DevOps 中对失败的 NUnit Selenium 测试进行故障排除

[英]Troubleshoot failing NUnit Selenium tests in Azure DevOps

I am trying to build an NUnit Selenium test suite, that I can run from within Azure DevOps, to perform functional testing on my companies web app.我正在尝试构建一个 NUnit Selenium 测试套件,我可以在 Azure DevOps 中运行它,以便对我的公司 web 应用程序执行功能测试。

I've built and testing a demo project locally, which creates a browser instance and authenticates the session with the web app in the OneTimeSetUp - the browser instance is then used to run a demo test.我已经在本地构建并测试了一个演示项目,它创建了一个浏览器实例,并使用 OneTimeSetUp 中的 web 应用程序对 session 进行身份验证 - 然后使用浏览器实例运行演示测试。 Where I encounter my primary issue is that when I run this test in DevOps, it fails during the OneTimeSetUp, and as such, it fails the test also.我遇到的主要问题是,当我在 DevOps 中运行此测试时,它在 OneTimeSetUp 期间失败,因此,它也未能通过测试。

I'm unsure how to resolve this, because as mentioned, locally, the test runs as desired.我不确定如何解决这个问题,因为如前所述,测试在本地运行。 I'm running the tests against the same web app.我正在针对同一个 web 应用程序运行测试。

A secondary issue I've encountered with this is that I've tried taking screenshots using the ((ITakesScreenshot)driver).GetScreenshot() method, so that I might be able to see where the test is having trouble, but no screenshots appear in the test results (where I understand they should appear (based off this video ))我遇到的第二个问题是我尝试使用 ((ITakesScreenshot)driver).GetScreenshot() 方法截取屏幕截图,以便我可以看到测试出现问题的地方,但没有出现屏幕截图在测试结果中(我理解它们应该出现的地方(基于此视频))

Without being able to see what the tests are doing in DevOps, I'm at a loss as to how to troubleshoot this issue.由于无法看到测试在 DevOps 中做了什么,我不知道如何解决这个问题。 Any tips, pointers, or resources on how to achieve this are greatly appreciated.非常感谢有关如何实现此目标的任何提示、指示或资源。

Troubleshoot failing NUnit Selenium tests in Azure DevOps在 Azure DevOps 中对失败的 NUnit Selenium 测试进行故障排除

Based on your description, you are creates a browser instance and authenticates the session with the web app in the OneTimeSetUp - the browser instance is then used to run a demo test, it shows you are running UI tests.根据您的描述,您将创建一个浏览器实例并使用 OneTimeSetUp 中的 web 应用程序对 session 进行身份验证 - 然后使用浏览器实例运行演示测试,它表明您正在运行 UI 测试。

So, you should make sure run your self-hosted agent as an interactive mode and a special configuration of the agents is required.因此,您应该确保以交互模式运行自托管代理,并且需要对代理进行特殊配置

Please check the detailed info from the documents UI testing considerations .请查看文档UI 测试注意事项中的详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM