Hi Titus,
Yeah it's works fine, I checked it now. But I want to understand why this
version of watir closes the browser while the previous doesn't? And why do
need to include such long code to not to close the browser while we have
done nothing in our previous version?
On Thursday, November 24, 2016 at 10:24:27 PM UTC+5:30, Titus Fortner wrote:
>
> `Watir::Browser.new :chrome` will let you use :chrome_options
>
> It is only if you are using `Watir::Browser.new :remote` that
> :chrome_options isn't translating right now. :-/
>
> On Thursday, November 24, 2016 at 10:48:43 AM UTC-6, Lucas Tierney wrote:
>>
>> Hi gary, can you try this instead:
>>
>> caps = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions:
>> {detach: true})
>>
>> On Thursday, November 24, 2016 at 3:15:05 AM UTC-6, gary wrote:
>>>
>>> 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]> 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.