running selenium tests with Firefox headless on osx
520 views
Skip to first unread message
William Kahn-Greene
unread,
Jan 5, 2017, 3:44:38 PM1/5/17
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dev-webdev
Hi!
When running selenium tests with the Firefox webdriver, it opens and
closes the window like a million times and prevents you from doing any
useful work for the duration of the test run. It's pretty irksome and
a time waste.
On Linux, we use xvfb to run selenium tests with the Firefox
webdriver. It's fairly straight-forward to set up. Works fine.
However, it seems overly complicated to set up xvfb on OSX to do the same thing.
Given that, what do all you OSX users do to run selenium tests with
the Firefox webdriver headless?
/will
Robert Helmer
unread,
Jan 5, 2017, 4:41:19 PM1/5/17
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to William Kahn-Greene, dev-webdev
My understanding (which is a few years old and may be wrong now!) is
that the Mac window service needs to be attached to a real graphics
device, and processes that connect to it need to be running locally.
Building Firefox for X11 for Darwin/Mach-O is apparently possible, but
you're not testing the same thing at all. You might as well just test
on Linux.
Mozilla does perf tests for Firefox by attaching a graphics dongle
that pretends to be a monitor (to be able to set the correct
resolution), and auto-logging into the desktop.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to William Kahn-Greene, dev-webdev
WebDriver does that because there are events that only fire when the
browser has focus.
I know that Myk is working on a headless Firefox for 2017+.
As for running headless in OSX, I think you would be fine with getting your
tests to run in a linux container unless there are specific features that
Firefox on OSX has that you want to test. If there is something specific to
OSX and Firefox then unfortunately it's going to continue to steal focus
(sorry).
David
Paul McLanahan
unread,
Jan 5, 2017, 4:59:12 PM1/5/17
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dev-webdev
I've not used this personally, but it looks like using docker-selenium[0] and Docker for $PLATFORM[1] should make this better and portable. I'd be interested to hear how it goes if you try this.