Bhuvnesh, I've not done this but need to...I would extend the WebDriverScreenshotOnFailure class and make that a @Component so that it gets picked up by Spring. This is similar to extending the PerStoryWebDriverSteps class. You can @Autowire the WebDriverProvider but using the other constructor arguments might be a bit more difficult.
In the end you may need to make a Factory bean to create the actual steps class. Hope that helps, Brian ----- Original message ----- From: "Bhuvnesh Pratap" <[1][email protected]> To: [2][email protected] Date: Tue, 28 Feb 2012 11:37:05 +0530 Subject: [jbehave-user] Using SeleniumScreenshotOnFailure with Spring Hello, I have been using the JBehave Selenium Configuration with Spring and have been following the etsy example. I am looking to get the failure screen shots generated for the failure case . Currently I am using SpringStepsFactory to load the steps with a spring beans in spite using the InstanceSteps Factory which is why I am kind of stuck to add SeleniumScreenshotOnFailure to the StepsFactory as it has been used in the trader example here : [3]https://github.com/jbehave/jbehave-web/blob/master/examples/tr ader-runner-selenium/src/main/java/org/jbehave/web/examples/trade r/selenium/TraderWebStories.java Now, I need a way to achieve this through my SpringStepsFactory in order to add this class to step list for having the failure screen shots generated after a scenario failure. Thanks, Bhuvnesh References 1. mailto:[email protected] 2. mailto:[email protected] 3. https://github.com/jbehave/jbehave-web/blob/master/examples/trader-runner-selenium/src/main/java/org/jbehave/web/examples/trader/selenium/TraderWebStories.java
