开发者

how to use setCaptureScreenShotOnFailure(true) in selenium

开发者 https://www.devze.com 2023-02-13 05:06 出处:网络
I have a test class to which i have added a constructor containing a method setCaptureScreenShotOnFailure(true)

I have a test class to which i have added a constructor containing a method setCaptureScreenShotOnFailure(true) There is an assert statement which gets failed in this test But even t开发者_StackOverflow社区hough there is no screenshot being captured ( i checked the selenium server directory) Can anyone explain how to work with this method in I understand i cannot use this in my setup method and i can only use in the individual test classes Is it correct?


Yes this is only for individual class. However, if you want more effective use then you can implement testng then create a screenshot class which extends to testlistener. So that you can capture screenshot during pass or faliure of tests. refer Selenium Testng Screenshot Listener

0

精彩评论

暂无评论...
验证码 换一张
取 消