You can pass in a chrome_option for detach: true -
https://sites.google.com/a/chromium.org/chromedriver/capabilities

caps = Selenium::WebDriver::Capabilities.chrome(chrome_options: {detach:
true})
Watir::Browser.new :chrome, desired_capabilities: caps

When the code exits it sends the command to kill the chromedriver process.
If with detatch == true it doesn't force all Chrome browsers opened by that
driver to also close. They will of course close if  you have your code set
to execute `browser.close`.

On Wed, Nov 23, 2016 at 8:04 AM, 'gary' via Watir General <
[email protected]> wrote:

> hi again,
> I'm now running on the latest for everything, with thanks to Titus and
> Alex. Ruby 2.6.8 & watir v6.
> I have noticed that whenever my scripts error the browser now closes
> automajically. This is handy if I'm running multiple scripts over night for
> example (even though I had a way to deal with that) but it makes it tricky
> on script creation.
> If I run a script which fails part way through lets say on an object which
> is missing. I would usually be on the correct page so can easily identify
> the missing object, update my script, re run, and carry on. Now the browser
> closes so I then have to navigate to the same page outside of my script
> which can take quite a while, especially when creating new scripts.
> Is there a way to allow the script to fail but keep the browser open where
> the script ended?
>
> Regards,
> G
>
> --
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Watir General" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to