how to use setCaptureScreenShotOnFailure(true) in selenium
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
精彩评论