Thanks for your reply Titus, unfortunately that didn't quite work 

require 'watir'
caps = Selenium::WebDriver::Capabilities.chrome(chrome_options: {detach: 
true})
@b = Watir::Browser.new :chrome, desired_capabilities: caps
@b.goto('www.google.co.uk')

:in `<main>': uninitialized constant Selenium::WebDriver::Capabilities 
(NameError)

but knowing that it's controlled by the chromedriver has given me an option 
to run scripts in firefox which doesn't close, thanks again, G

On Wednesday, 23 November 2016 15:18:31 UTC, Titus Fortner wrote:
>
> 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] <javascript:>> 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] <javascript:>
>> http://groups.google.com/group/watir-general
>> [email protected] <javascript:>
>>
>> --- 
>> 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] <javascript:>.
>> 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