Giter Club home page Giter Club logo

Comments (20)

leonid-shevtsov avatar leonid-shevtsov commented on June 4, 2024 11

I'm sorry, but Headless would only work with applications using the X Server on OSX. Practically any native OSX application uses Quartz, the OSX graphics subsystem, and not X. That includes Chrome and Firefox on OSX.

The X Windowing System is the primary graphics subsystem for Linux, thus most, if not all, graphical Linux apps use the X Server and can be ran "headlessly" with Headless. That includes Chrome and Firefox on Linux.

On OSX the X Server is only included for compatibility (that's why it's not even packaged with 10.8). For example, Wine apps on OSX use the X Server, and some utilities from Linux land do.

If there is a way to run Quartz applications headlessly, then I know nothing about it and supporting Quartz is not a goal of Headless.

Read up here:

http://en.wikipedia.org/wiki/X_server
http://en.wikipedia.org/wiki/Quartz_(graphics_layer)

from headless.

charleshuang80 avatar charleshuang80 commented on June 4, 2024 5

Using Mac OS X El Capitan. I had installed the latest XQuartz 2.7.9, and when running my tests kept getting Xvfb is frozen (Headless::Exception). I looked all over for fixes to no avail (and this issue page kept popping up in my searches), and just couldn't get xvfb to run. Finally, I came across this post https://discussions.apple.com/thread/7590534?start=0&tstart=0. So I uninstalled XQuartz 2.7.9 (https://xquartz.macosforge.org/trac/wiki/X11-UsersFAQ#UninstallSnowLeopardorLater), and installed XQuartz 2.7.8, and running my tests ran without any errors from headless.

from headless.

kmb89144 avatar kmb89144 commented on June 4, 2024 1

I followed your guide, and am using headless in object mode, however whenever I launch chrome, it's not actually running headless. I've verified that xvfb is installed (path is /usr/X11/bin/xvfb). I'm using OS X (version 10.7.4).

headless = Headless.new
headless.start
driver = Selenium::WebDriver.for :chrome
driver.navigate.to 'http://www.google.com'

Thanks!

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on June 4, 2024

Make sure that xvfb is available in PATH. Headless just calls which xvfb to locate the executable.

Still, this isn't really "OSX support", since xvfb will only work with X applications, which are a very small subset of (ususally non-native) OS X applications.

from headless.

introvert avatar introvert commented on June 4, 2024

I have the same problem on OS X Lion (10.8.2). I installed XQuartz and I have xvfb on my hd. When I run the demo code the browser doesn't run headless.
I get no error.

Any idea?

from headless.

introvert avatar introvert commented on June 4, 2024

Thanks for explanation.
Is there any way to run Firefox headlessly on OS X?

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on June 4, 2024

If you want to avoid the window popping up when you are running tests, maybe pinning it to a separate Space will help. Or starting it in the background (open --hide /Applications/Firefox.app/Contents/MacOS/firefox)

from headless.

introvert avatar introvert commented on June 4, 2024

Leonid, thanks for this.
Do you maybe know how its possible to launch firefox in the background / in silent mode with Watir?
It doesn't appear that it supports passing arguments to the browser..

from headless.

ultrageek avatar ultrageek commented on June 4, 2024

PhantomJS runs headlessly on Mac OS X using an agnostic WebKit-based browser. I believe it uses Xvfb to accomplish this? It's been a while, so I'm not 100% sure of the details.

I understand someone has a capybara/phantomjs gem. Not sure if there's a hybrid solution in there for Headless

from headless.

tispratik avatar tispratik commented on June 4, 2024

Should we put it in the readme, that headless gem does not support mac osx? As, its confusing people and searching all over to find an answer.

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on June 4, 2024

But it is right there in the 5th paragraph of the readme. In bold. :)

from headless.

tispratik avatar tispratik commented on June 4, 2024

Oh ok, its probably not direct. Headless will not hide :). We can probably say it directly, "headless" is not for mac osx in the very first paragraph.

from headless.

leehambley avatar leehambley commented on June 4, 2024

Could it possibly be made not to require XVfb on OSX? it's a bit annoying to have to install a 1.5Gb package, in order to not use it. I'm sure the answer is "Don't use headless on OSX", but building an implementation that swaps out Headless for NotHeadless based on RUBY_PLATFORM seems like something that might be more widely useful than just at my client's place?

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on June 4, 2024

@leehambley could you elaborate on the problem you're having? If you're not using Headless, why do you need to install Xvfb?

The 1.5G package can't be avoided, because Xvfb is just a small slice of the entire X Server layer, all of which is required for the apps to work.

from headless.

leehambley avatar leehambley commented on June 4, 2024

We use headless in the test helper for the city server, so its always
loaded, and in all setup and teardown blocks.

Ideally headless would switch on RUBY_PLATFORM and just do nothing on osx
(ie not even check for xvfb)

On Sep 12, 2013 10:03 AM, "Leonid Shevtsov" [email protected]
wrote:

@leehambley could you elaborate on the problem you're having? If you're
not using Headless, why do you need to install Xvfb?

The 1.5G package can't be avoided, because Xvfb is just a small slice of
the entire X Server layer, all of which is required for the apps to work.


Reply to this email directly or view it on GitHub.

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on June 4, 2024

OK, I'll think about it.

from headless.

ABorovenskyi avatar ABorovenskyi commented on June 4, 2024

Have found solution of the issue here
https://github.com/firstbanco/jasmine-coverage/issues/5#issuecomment-21822887

from headless.

daluu avatar daluu commented on June 4, 2024

FYI, for those pointing out xvfb issue for FF and Chrome on Mac (for Selenium, etc.), you may need to find an x11 build/version of FF (and/or Chrome, but for Mac?), not the standard OS binary/install. This old article is one reference: http://afitnerd.com/2011/09/06/headless-browser-testing-on-mac/

from headless.

molfar avatar molfar commented on June 4, 2024

is there any fallback for mac os? Just to skip xvfb requirement, without no code change

from headless.

0xGuybrush avatar 0xGuybrush commented on June 4, 2024

FYI, for those pointing out xvfb issue for FF and Chrome on Mac (for Selenium, etc.), you may need to find an x11 build/version of FF (and/or Chrome, but for Mac?), not the standard OS binary/install. This old article is one reference: http://afitnerd.com/2011/09/06/headless-browser-testing-on-mac/

For reference, this is now at http://old.afitnerd.com/2011/09/06/headless-browser-testing-on-mac/

from headless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.