0

I am trying to prevent browser to close after my test scenario, I have tried several things found from online resources but nothing worked so far.

The goal is to prevent the browser to get closed and keep manually from a certain point, like a 'checkpoint', is there any way to do this?

I have tried :

@After("@leave_window_open")

but seems it is working only if the Scenario is failing.

is there any simple way to block this behavior, and avoiding debugging?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
OEH
  • 665
  • 11
  • 29
  • Possible duplicate of [How to keep the browser open after test execution when using selenium web driver](https://stackoverflow.com/questions/17247536/how-to-keep-the-browser-open-after-test-execution-when-using-selenium-web-driver) – Adelin Jan 15 '18 at 11:54
  • sorry it is not useful, my goal is to keep it open and continue manually – OEH Jan 15 '18 at 11:57
  • @OEH What is "@leave_window_open"? What happens if u do not call quit or close on the driver. – Grasshopper Jan 15 '18 at 13:07

1 Answers1

1

The browser won't close unless you call .close() or .quit(). You must have those calls somewhere... just remove them. If you are looking for a intermittent fix, just add a breakpoint where you want the script to stop. Once the run breaks, stop the execution and continue manually. I do this all the time for debugging purposes.

JeffC
  • 22,180
  • 5
  • 32
  • 55
  • I thought about this... could not find any reference to those two functions, thank I thought it is an out of the box behaviour – OEH Jan 15 '18 at 16:50