简体   繁体   English

如果测试用例中的某个步骤失败但测试用例通过,即使测试用例的最终状态通过,范围报告也会显示整个测试用例失败

[英]If a step fails in a test case but test cases passes , extent report shows whole test case as failed even though final status of test case is passed

I am using DataProvider for my test cases, and with one of the data a step fails in test case but test case passes, testNG shows the test case as passed but extent report show it as failed.我正在为我的测试用例使用 DataProvider,并且其中一个数据在测试用例中步骤失败但测试用例通过,testNG 显示测试用例通过但范围报告显示它失败。 Extent Report screenshot范围报告屏幕截图

To provide the reportStep("Sample Test", "pass");提供reportStep("Sample Test", "pass"); in each testcase.在每个测试用例中。

eg:例如:

@test
public void verifylogin(){
reportStep("UserName entered successfully", "pass");
}

@test
public void verifylogin(){
reportStep("Email entered successfully", "pass");
}

So that you got the output like this enter image description here这样您就可以得到像这样的 output在此处输入图像描述

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

相关问题 范围报告仅显示最后一个测试用例结果 - Extent report shows only last test case result 无法跳过通过的测试用例,仅在testNG中测试失败的测试用例 - Unable to skip passed test cases and test only failed test case in testNG 扩展报告:日志被追加到报告中的单个测试用例上 - Extent Reports: Logs are Getting Appended on to a Single Test Case in the Report 在范围报告中拍摄失败的测试用例的屏幕快照后,出现图像的缩略图,但没有图像显示 - Thumbnail of image appears but no image shows after taking screenshot of failed test case in extent reports 即使在测试用例失败后,Selenium脚本的执行 - Execution of Selenium Script even after Test case fails 在范围报告中添加测试用例失败原因 - add test cases failure reason in extent report WebDriver测试用例的问题 - Issue with WebDriver test case 如果测试用例在 testNG 中失败,如何运行 class - How to run class if test case failed in testNG Selenium WebDriver:如何在失败的测试用例中在testNG中执行完整的测试 - Selenium WebDriver: How to execute complete Test in testNG for a failed test case 测试用例执行完成后,无论是否通过,如何将测试用例结果保存在变量中? - How can I save test case result in a variable whether it is passed or not after the test case execution is done?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM