chrome headless with selenium grid

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

chrome headless with selenium grid

Dan Martin
I have not been able to get Chrome to run headless when running through a hub. Has anyone solved this? I can pass the chrome headless option directly to a node using the webdriver for chrome, but cannot make it work using webdriver for remote.

Firefox has an environmental variable that I can set, MOZ_HEADLESS, which works like a charm. I have not been able to locate the equivalent in Chrome. 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0610c959-04e7-4f21-addd-652bff32ef00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: chrome headless with selenium grid

Prvn
Try

            List<String> argumentsList = Arrays.asList("headless", "no-sandbox");

            chromeOptions.setCapability(CapabilityType.PLATFORM_NAME, Platform.LINUX);

            chromeOptions.addArguments(argumentsList);


On Tuesday, May 1, 2018 at 5:58:05 PM UTC-4, Dan Martin wrote:
I have not been able to get Chrome to run headless when running through a hub. Has anyone solved this? I can pass the chrome headless option directly to a node using the webdriver for chrome, but cannot make it work using webdriver for remote.

Firefox has an environmental variable that I can set, MOZ_HEADLESS, which works like a charm. I have not been able to locate the equivalent in Chrome. 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/bcf2add6-57b2-4f4b-807d-875067034d75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: chrome headless with selenium grid

Jonathan Herbaut
I add arguments headless, disable-gpu and disable-infobars to use an headless version of Chrome

public static RemoteWebDriver SetupRemoteChromeDriver(PlatformType platform, string version, bool headless = false)
{
var options = new ChromeOptions();
if (headless)
{
options.AddArgument("headless");
options.AddArgument("disable-gpu");
}
options.AddArguments("disable-infobars");
options.AddAdditionalCapability(CapabilityType.Platform, platform.ToString().ToUpper(), true);
options.AddAdditionalCapability(CapabilityType.Version, version, true);
return RemoteBuilder.SetupRemoteWebDriver(options);
}

Le mercredi 2 mai 2018 16:05:36 UTC+2, Prvn a écrit :
Try

            List<String> argumentsList = Arrays.asList("headless", "no-sandbox");

            chromeOptions.setCapability(CapabilityType.PLATFORM_NAME, Platform.LINUX);

            chromeOptions.addArguments(argumentsList);


On Tuesday, May 1, 2018 at 5:58:05 PM UTC-4, Dan Martin wrote:
I have not been able to get Chrome to run headless when running through a hub. Has anyone solved this? I can pass the chrome headless option directly to a node using the webdriver for chrome, but cannot make it work using webdriver for remote.

Firefox has an environmental variable that I can set, MOZ_HEADLESS, which works like a charm. I have not been able to locate the equivalent in Chrome. 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f552aa0c-cd4f-48d9-9832-96395f082cad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: chrome headless with selenium grid

Dan Martin
Thanks. I was aware of the options, but was having a hard time encoding them in Ruby. This helped me get there.



On May 2, 2018, at 9:56 AM, Jonathan Herbaut <[hidden email]> wrote:

I add arguments headless, disable-gpu and disable-infobars to use an headless version of Chrome

public static RemoteWebDriver SetupRemoteChromeDriver(PlatformType platform, string version, bool headless = false)
{
var options = new ChromeOptions();
if (headless)
{
options.AddArgument("headless");
options.AddArgument("disable-gpu");
}
options.AddArguments("disable-infobars");
options.AddAdditionalCapability(CapabilityType.Platform, platform.ToString().ToUpper(), true);
options.AddAdditionalCapability(CapabilityType.Version, version, true);
return RemoteBuilder.SetupRemoteWebDriver(options);
}

Le mercredi 2 mai 2018 16:05:36 UTC+2, Prvn a écrit :
Try

            List<String> argumentsList = Arrays.asList("headless", "no-sandbox");

            chromeOptions.setCapability(CapabilityType.PLATFORM_NAME, Platform.LINUX);

            chromeOptions.addArguments(argumentsList);


On Tuesday, May 1, 2018 at 5:58:05 PM UTC-4, Dan Martin wrote:
I have not been able to get Chrome to run headless when running through a hub. Has anyone solved this? I can pass the chrome headless option directly to a node using the webdriver for chrome, but cannot make it work using webdriver for remote.

Firefox has an environmental variable that I can set, MOZ_HEADLESS, which works like a charm. I have not been able to locate the equivalent in Chrome. 

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/dSxJtR1hOYs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f552aa0c-cd4f-48d9-9832-96395f082cad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Martin



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/BD330ADE-9AAB-40B0-ABFA-FCECC23035F5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.