I got this working now I believe. I had been using WebDriver in my setup and test code. When I changed that to use WebDriverProvider instead, I now get screenshots generated.
Regards, Christian P.S. I now struggle with understanding why the tests are opening 2 Firefox windows each run. I think that's been asked and answered earlier but I haven't googled the right place yet. D.S. Från: Karlsson Christian [mailto:[email protected]] Skickat: den 4 mars 2013 12:29 Till: [email protected] Ämne: SV: [jbehave-user] Screenshots not being generated Hi I generated a new Maven project with jbehave-web-selenium-java-spring-archetype Changed one assert to expect less than 1 hits. Run mvn integration-test -Pannotated-embedder And I don't get the "screenshot" directory generated in jbehave target directory. /Christian Från: Mauro Talevi [mailto:[email protected]] Skickat: den 3 mars 2013 12:20 Till: [email protected]<mailto:[email protected]> Ämne: Re: [jbehave-user] Screenshots not being generated Hi Christian, could you send us an example project that reproduce your problem and that we can use to investigate the issue? The simplest possible Maven project will do. Cheers On 01/03/2013 14:08, Karlsson Christian wrote: Hi all I'm running JBehave driven selenium tests of our system. When we get failures the reports include links to a screenshot of the failure. My problem is that the actual screenshot doesn't get generated. I have config like: @RunWith(SpringAnnotatedEmbedderRunner.class) @Configure(using = SeleniumConfiguration.class, pendingStepStrategy = FailingUponPendingStep.class) @UsingEmbedder(embedder = Embedder.class, generateViewAfterStories = true, ignoreFailureInStories = true, ignoreFailureInView = false, storyTimeoutInSecs = 600, threads = 1, metaFilters = "-skip") @UsingSpring(resources = { "steps.xml" }) public class MyStories extends InjectableEmbedder { And my html report says: org.openqa.selenium.TimeoutException: Timed out after 20 seconds waiting for element to be clickable: By.linkText: Frtsätt Build info: version: '2.30.0', revision: 'dc1ef9ceb805a672f56dc49198f9ffbd4ca345c7', time: '2013-02-19 09:14:38' System info: os.name: 'Windows NT (unknown)', os.arch: 'amd64', os.version: '6.2', java.version: '1.6.0_23' Driver info: driver.version: unknown <broken link to failing screenshot> The ReporterBuilder: Format[] formats = new Format[] { new SeleniumContextOutput(seleniumContext), CONSOLE, TXT, WEB_DRIVER_HTML, XML }; StoryReporterBuilder reporterBuilder = new StoryReporterBuilder() .withCodeLocation(codeLocationFromClass(this.getClass())) .withFailureTraceCompression(true) .withRelativeDirectory("jbehave-reports").withDefaultFormats() .withFormats(formats).withKeywords(keywords) .withCrossReference(crossReference).withFailureTrace(true); Can anyone spot why I don't get the screenshots? I've read a lot about overriding the stepsFactory but I can't seem to figure out if I need that since I don't use JUnitStories. Is it that I should call injectedEmbedder().useStepsFactory(some instance)? TIA, Christian Christian Karlsson CAG Contactor AB Adress: Jan Stenbecks Torg 17, SE-164 40 Kista Mobil: +46 (0)706694527 Mail: christian.karlsson <at> cag.se www.cag.se<https://wmail.cag.se/owa/redir.aspx?C=G2EjVQkj7kGZyieqy24uGB6NV2uAkM9Iy3xqV4cZFUaEVGXCGlWIq_V5O25t1jIUtjHgAaGFl0U.&URL=http%3a%2f%2fwww.cag.se%2f>
