William, If you generate an xml report (see the examples), you will get something that looks like this:
<story path="classpath:/stories/authentication/default_policy.story" title="Login with Default Authentication Policy"> <narrative keyword="Narrative:"> <inOrderTo keyword="In order to">access the system</inOrderTo> <asA keyword="As a">user with my username and password</asA> <iWantTo keyword="I want to">login to the system for my organization</iWantTo> </narrative> <scenario keyword="Scenario:" title="Valid login"> <step outcome="successful">Given an organization named <parameter>Microsoft</parameter></step> <step outcome="successful">And a default authentication policy for <parameter>Microsoft</parameter></step> <step outcome="successful">And a user for <parameter>Microsoft</parameter> with username <parameter>billgates</parameter> and password <parameter>windows</parameter></step> <step outcome="successful">When current organization is <parameter>Microsoft</parameter></step> <step outcome="successful">And user <parameter>billgates</parameter> authenticates with password <parameter>windows</parameter></step> <step outcome="successful">Then user should be authenticated</step> </scenario> which you might be able to parse or transform (xslt) into a selenium report. The other option - which I'm not too clear on - is to write your own monitor class which is given certain events during the lifecycle of a test execution and you could do your SoftistSeleniumReport in your monitor class. Hope that helps. Brian ----- Original message ----- From: "William Breternitz" <[email protected]> To: [email protected] Date: Wed, 15 Sep 2010 17:36:03 -0300 Subject: RES: [jbehave-user] Can I get scenario's title before test start? Hi Brian! Thank you for the fast answer. I will try be more clear. You is right, I need it to give the test name to selenium’s report. Please, can you send a example that how can I get the scenario’ name or how can I do it into my class? public class StepsFrameWorkAutomacao extends Steps { @BeforeScenario public void setUp() throws Exception { String testName = ("Login"); // ***** I need get the test title here ***** sft = new SofistSeleniumReport(this.getClass().getName(), testName, this.getClass().getClassLoader().getResource("\\automacao.propert ies").toURI().getPath()); selenium = sft.configReportAndApp(); ref = new ProvedorCaminhosManual(); func = new FuncionalidadeSynGui(selenium); } Regards, [1]William Breternitz | analista de teste de software | Tel: +55 19 3794 1681 cid:[email protected] Ramal: 1707 | [2]Synchro Solução Fiscal – 18 anos | SPED | NFe | CTe | Classificação Fiscal De: Brian Repko [mailto:[email protected]] Enviada em: quarta-feira, 15 de setembro de 2010 17:02 Para: [email protected] Assunto: Re: [jbehave-user] Can I get scenario's title before test start? William, I'm a bit confused. You say you want it before/during the test execution, but that you need it for report / view generation. My understanding (which I would verify by running the spring-security example) is that the name is available and that you would want to implement the report generation in a way that is compatible with selenium. I believe that the data is for report generation - will that work for you? Brian ----- Original message ----- From: "William Breternitz" <[email protected]> To: [email protected] Date: Wed, 15 Sep 2010 16:36:53 -0300 Subject: [jbehave-user] Can I get scenario's title before test start? Hello, please I need help. I want know how if I can get the scenario´s title (dynamically) before the test run. Is it possible? I tried the annotation @BeforeScenario in the step’s class but I didn’t find the way to get this information. Also I tried instance a scenario object and use de method “getTitle” but I got an empty result. It is very important to me get scenario’s name because I want to generate selenium reports with this information. Please, check the attachments. Thanks in advance. [3]William Breternitz | analista de teste de software | Tel: +55 19 3794 1681 cid:[email protected] Ramal: 1707 | [4]Synchro Solução Fiscal – 18 anos | SPED | NFe | CTe | Classificação Fiscal --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --- Brian Repko LearnThinkCode, Inc. email: [email protected] phone: +1 612 229 6779 References 1. mailto:[email protected] 2. http://www.synchro.com.br/ 3. mailto:[email protected] 4. http://www.synchro.com.br/ --- Brian Repko LearnThinkCode, Inc. email: [email protected] phone: +1 612 229 6779
<<attachment: image001.gif>>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
