From 466b689c1d95695d915620eb6390eaf0826aced5 Mon Sep 17 00:00:00 2001 From: Alexandre ZANNI <16578570+noraj@users.noreply.github.com> Date: Wed, 15 Mar 2023 12:06:15 +0100 Subject: [PATCH] Add headless info --- _guides/firefox.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/_guides/firefox.md b/_guides/firefox.md index 72f662a8..0e8a2ebd 100644 --- a/_guides/firefox.md +++ b/_guides/firefox.md @@ -19,6 +19,22 @@ version available to have the most complete feature set. b = Watir::Browser.new :firefox {% endhighlight %} +### Headless + +Firefox has a headless feature that can be accessed directly with: + +{% highlight ruby %} +b = Watir::Browser.new :firefox, headless: true +{% endhighlight %} + +However this syntax is deprecated by Selenium so the following syntax should be prefered. + +{% highlight ruby %} +b = Watir::Browser.new :firefox, options: {args: ['-headless']} +{% endhighlight %} + +It also possible to use [the Headless gem](/guides/headless/). + ### Firefox Options All options are explained on the [geckodriver page](https://github.com/mozilla/geckodriver#webdriver-capabilities)