How to run browser tests in headless mode?

2,161 views
Skip to first unread message

bpant

unread,
Nov 6, 2010, 7:26:27 PM11/6/10
to webdriver
How can I force the browser windows to be hidden when using Webdriver?

I guess this may be easier on linux than in windows, (if I can use the
multiple desktops perhaps?), but is there support built into Webdriver/
Selenium for this? This may be very helpful so one can have tests
running on their machine without disrupting their usual work.

digiarnie

unread,
Nov 7, 2010, 3:18:09 AM11/7/10
to webdriver

Matt

unread,
Nov 8, 2010, 3:57:43 PM11/8/10
to webdriver
It would be helpful if someone would post steps to running firefox/
chrome webdriver in headless mode. HtmlUnit won't work, there are too
many differences between the firefox driver and htmlunit (especially
when dealing with heavy javascript sites).

Matt

On Nov 7, 1:18 am, digiarnie <digiar...@gmail.com> wrote:
> You can use:
>
> WebDriver driver = new HtmlUnitDriver();
>
> Seehttp://selenium.googlecode.com/svn/trunk/docs/api/java/index.html?org...

Daniel Wagner-Hall

unread,
Nov 10, 2010, 2:27:23 PM11/10/10
to webdriver
If you're on Linux you can roughly:

Install Xephyr: http://ubuntuforums.org/showthread.php?t=620003 (sudo
apt-get install xserver-xephyr)
Execute:

Xephyr :1 -ac -screen 1024x768 &
DISPLAY=:1 gnome-terminal -x whatever-command-executes-your-tests-here &
DISPLAY=:1 metacity &

e.g. for our test suite we would run:

Xephyr :1 -ac -screen 1024x768 &
DISPLAY=:1 gnome-terminal -x ./go test &
DISPLAY=:1 metacity &

> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>

bpant

unread,
Nov 15, 2010, 11:02:02 AM11/15/10
to webdriver
Thanks I will try the xephyr thing some time, I am already using
htmlunit

On Nov 10, 2:27 pm, Daniel Wagner-Hall <dawag...@gmail.com> wrote:
> If you're on Linux you can roughly:
>
> Install Xephyr:http://ubuntuforums.org/showthread.php?t=620003(sudo
> apt-get install xserver-xephyr)
> Execute:
>
> Xephyr :1 -ac -screen 1024x768 &
> DISPLAY=:1 gnome-terminal -x whatever-command-executes-your-tests-here &
> DISPLAY=:1 metacity &
>
> e.g. for our test suite we would run:
>
> Xephyr :1 -ac -screen 1024x768 &
> DISPLAY=:1 gnome-terminal -x ./go test &
> DISPLAY=:1 metacity &
>

Alister Scott

unread,
Aug 29, 2011, 2:09:24 AM8/29/11
to webd...@googlegroups.com
You can use the headless gem in ruby to run real browsers headlessly: http://watirmelon.com/2011/08/27/running-headless-watir-webdriver-tests-using-a-real-browser/
Reply all
Reply to author
Forward
0 new messages