Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start Firefox in headless mode #506

Closed
olleharstedt opened this issue Nov 23, 2017 · 4 comments
Closed

Start Firefox in headless mode #506

olleharstedt opened this issue Nov 23, 2017 · 4 comments
Labels
waiting for reaction Further information/reaction is requested

Comments

@olleharstedt
Copy link

olleharstedt commented Nov 23, 2017

What are you trying to achieve? (Expected behavior)

As with Chrome, I want to be able to start Firefox in headless mode.

What do you get instead? (Actual behavior)

Can't find any method similar to the ChromeOptions->addArguments(); Can I use setPreference()?

How could the issue be reproduced? (Steps to reproduce)

// You can insert your PHP code here (or remove this block if it is not relevant for the issue).

Details

  • Php-webdriver version:
  • PHP version:
  • Selenium server version:
  • Operating system:
  • Browser used + version:
@olleharstedt
Copy link
Author

Possible solution: Use export MOZ_HEADLESS=1 before running selenium.

@OndraM
Copy link
Collaborator

OndraM commented Dec 5, 2017

Hi, I believe you can pass the settings via desired capabilities:

$capabilities = DesiredCapabilities::firefox();

$capabilities->setCapability(
    'moz:firefoxOptions',
   ['args' => ['-headless']]
);

$driver = RemoteWebDriver::create($host, $capabilities);

@olleharstedt Could you please try this solution as well? I will add it to the wiki then.

@OndraM OndraM added the waiting for reaction Further information/reaction is requested label Dec 5, 2017
@olleharstedt
Copy link
Author

Thanks, I'll try this.

@lgraziani2712
Copy link

I can confirm this works.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for reaction Further information/reaction is requested
Projects
None yet
Development

No branches or pull requests

3 participants