chrome headless with selenium grid

已查看 171 次
跳至第一个未读帖子

Dan Martin

未读,
2018年5月1日 17:58:052018/5/1
收件人 Selenium Users
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. 

Prvn

未读,
2018年5月2日 10:05:362018/5/2
收件人 Selenium Users
Try

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

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

            chromeOptions.addArguments(argumentsList);

Jonathan Herbaut

未读,
2018年5月2日 10:56:452018/5/2
收件人 Selenium Users
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);

Dan Martin

未读,
2018年5月15日 16:37:452018/5/15
收件人 seleniu...@googlegroups.com
Thanks. I was aware of the options, but was having a hard time encoding them in Ruby. This helped me get there.



--
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 selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
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



回复全部
回复作者
转发
0 个新帖子