Created
April 6, 2018 08:49
-
-
Save melagiri/32bed04b91cf656a3b2016f757a1b7c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestStepListener extends BasePortalTest implements StepLifecycleListener | |
| { | |
| public void beforeStepStop(final StepResult result) | |
| { | |
| System.out.println("Step: " + result.getName() + ": " + result.getStatus()); | |
| try | |
| { | |
| // Get Test Instance | |
| WebDriver driver = ((BasePortalTest) this).browser; | |
| File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); | |
| FileUtil.moveFile(screenshot, new File(testLogFolder.getPath() + "\\" + result.getName() + ".png")); | |
| } | |
| catch (Exception e) | |
| { | |
| System.out.println("Failed Exception"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment