Thanks Christian,

It would appear that the best solution for this particular application is
to delete the cookies on the first step just before the get.

Regards,

Paul


On 24 May 2013 08:27, Karlsson Christian <[email protected]> wrote:

>  Hi Paul****
>
> To achieve ’b’ in your question I remove session cookies at the end of a
> scenario. Could that be a solution for you perhaps?****
>
> ** **
>
>     @AfterScenario****
>
>     *public* *void* destroy() {****
>
>         webDriverProvider.get().manage().deleteAllCookies();****
>
>     }****
>
> ** **
>
> Regards,****
>
> 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>
> ****
>
> ** **
>
> *Från:* Paul Mander [mailto:[email protected]]
> *Skickat:* den 23 maj 2013 17:14
> *Till:* user
> *Ämne:* [jbehave-user] Re: Handling failure in Parameterized scenarios****
>
> ** **
>
> I have a sort of solution.****
>
> ** **
>
> I can add the following to a step class****
>
> ** **
>
>         @AfterScenario(uponType=ScenarioType.EXAMPLE,
> uponOutcome=Outcome.FAILURE)****
>
>                       public void end() throws Exception {****
>
>                                             pages.loginPage().end();****
>
>                       }****
>
> ** **
>
>         @BeforeScenario(uponType=ScenarioType.EXAMPLE)****
>
>                       public void start() throws Exception {****
>
>                                             pages.loginPage().start();****
>
>                       }****
>
> ** **
>
> and then this to the page object:****
>
> ** **
>
>         public void start() throws Exception {****
>
>                                             if (init) {****
>
>
> ((RemoteWebDriverProvider) getDriverProvider()).initialize();****
>
>                                                                  init =
> false;****
>
>                                             }****
>
>                       }****
>
> ** **
>
>                       private boolean init = false;****
>
> ** **
>
>                       public void end() {****
>
>                                             ((RemoteWebDriverProvider)
> getDriverProvider()).end();****
>
>                                             init = true;****
>
>                       }****
>
> ** **
>
> Not very elegant but it will end the session on an example failure and
> start the next one if it was ended. Not going to work for a multi-threaded
> scenario though. ****
>
> ** **
>
> On 23 May 2013 14:10, Paul Mander <[email protected]> wrote:****
>
> I'm using jbehave and selenium to perform regression tests on an
> application as part of my CI process. I want to expand the coverage of
> these tests which means running the same scenarios hundreds of time with
> different data.****
>
> ** **
>
> I am using Parameterized scenarios such as****
>
> ** **
>
> When <user> logs on with password <pass>****
>
> Then landing page is shown****
>
> When user searches for customer <customer>****
>
> Then the customer name "<name>" is shown****
>
> When user logs off****
>
> The logon page is shown****
>
> ** **
>
> Examples:****
>
> |user|pass|customer|name|****
>
> |test1|test1|001|Fred Bloggs|****
>
> |test1|test1|001|George Bloggs|****
>
> |test1|test1|001|Susan Bloggs|****
>
> |test2|test2|001|Fred Bloggs|****
>
> |test2|test2|001|George Bloggs|****
>
> |test2|test2|001|Susan Bloggs|****
>
> ** **
>
> etc****
>
> ** **
>
> I know how to configure the tests so that that continue with other stories
> and scenarios if a failure happens but I need also to ****
>
> ** **
>
> a) run the example line in the example if one fails****
>
> b) start a new browser session for each example****
>
> ** **
>
> I need 'b' because the failure would not log off the app...****
>
> ** **
>
> Thanks****
>
> ** **
>
> ** **
>
> ** **
>

Reply via email to