Discussion:
[Cucumber] Stop closing browser after each scenario cucumber
Magesh Kumar
2018-06-20 05:02:13 UTC
Permalink
Hi,

In my test case i have three scenarios to access web application and
manipulate with it.

But the browsers closed after each scenario.Can any one please let me
know, how to stop closing the browser and use same browser instance for all
the scenarios
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thomas Sundberg
2018-06-26 05:34:54 UTC
Permalink
Hi,
In my test case i have three scenarios to access web application and manipulate with it.
But the browsers closed after each scenario.Can any one please let me know, how to stop closing the browser and use same browser instance for all the scenarios
You are most likely calling browser.quit() or possible browser.close()
somewhere. The trick is not to do that until you are done using that
browser instance. Unfortunately, it is hard to say more without seeing
your code. Please share more details about your code and we might be
able to help you better. Details include the step from where you call
close() or quit() on your browser abstraction.

I your scenarios pass and your only problem is that the browser is
shut down between every execution, I would expect that the closing is
done either in your last then step or in an after hook.

Sorry for being vague, but without more details it is hard to be more concrete.
Thomas
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
For more options, visit https://groups.google.com/d/optout.
--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://www.thinkcode.se/blog
Twitter: @thomassundberg

Better software through faster feedback
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Koen Prins
2018-06-30 18:06:07 UTC
Permalink
I would even go further and say that it can be desirable to close the
browser after a scenario to ensure a clean setup.
If you now run into the problem that your test is taking to long, you need
to change the way you are automating your tests.
If you need the browser to stay open so you can share state between
scenario's, well, don't do that.
Post by Magesh Kumar
Post by Magesh Kumar
Hi,
In my test case i have three scenarios to access web application and
manipulate with it.
Post by Magesh Kumar
But the browsers closed after each scenario.Can any one please let me
know, how to stop closing the browser and use same browser instance for all
the scenarios
You are most likely calling browser.quit() or possible browser.close()
somewhere. The trick is not to do that until you are done using that
browser instance. Unfortunately, it is hard to say more without seeing
your code. Please share more details about your code and we might be
able to help you better. Details include the step from where you call
close() or quit() on your browser abstraction.
I your scenarios pass and your only problem is that the browser is
shut down between every execution, I would expect that the closing is
done either in your last then step or in an after hook.
Sorry for being vague, but without more details it is hard to be more concrete.
Thomas
Post by Magesh Kumar
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
Post by Magesh Kumar
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Thomas Sundberg
M. Sc. in Computer Science
Mobile: +46 70 767 33 15
Blog: http://www.thinkcode.se/blog
Better software through faster feedback
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...