简体   繁体   English

selenium webdriver 中未生成失败测试用例的屏幕截图

[英]Screenshot for failed test case is not getting generated in selenium webdriver

I have defined the takeScreenshot and ITestListener interfaces in my project.我在我的项目中定义了 takeScreenshot 和 ITestListener 接口。 when am trying to run the Test method am getting NullPointerException and.jpg file is not generating.当我尝试运行测试方法时,我得到 NullPointerException 并且 .jpg 文件没有生成。

Can anyone please help me out.s谁能帮帮我.s

FYI NullPointerException can happen for many reasons.仅供参考NullPointerException可能由于多种原因而发生。

I would suggest you go over any simple example and double-check what was done wrong or specify the details of your implementation.我建议您通过任何简单的示例 go 并仔细检查做错了什么或指定您的实施细节。 For example, your public class TestListener implements ITestListener and how you declare it in testng.xml例如,您的public class TestListener implements ITestListener以及如何在testng.xml中声明它

It will be much easier for us to identify what caused the problem.我们将更容易确定导致问题的原因。

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

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