Headless Problem

141 views
Skip to first unread message

Eachus Lonny

unread,
May 5, 2013, 1:33:49 AM5/5/13
to watir-...@googlegroups.com

Operating environment: Mac OS X 10.8.3, Ruby 2.0.0.

I have installed the headless gem, but it is not working for me. Watir-webdriver works fine, but headless did not.

This is my code:

require 'watir-webdriver'
require 'headless'

headless = Headless.new
headless.start

b = Watir::Browser.start 'google.com'

...

b.close
headless.destroy

This all works just fine, with no error messages… but it's not headless. I get a normal Firefox window. (Firefox is my default browser.)

Xvfb is installed and seems to be working fine:

$ which xvfb
#=> /opt/X11/bin/xvfb

I would appreciate some help if anyone has run into this before. I did not find this particular problem in my watir-general digests.

Thanks.

Lonny Eachus
===========

Oscar Rieken

unread,
May 5, 2013, 1:47:06 AM5/5/13
to watir-...@googlegroups.com
https://github.com/leonid-shevtsov/headless  
Note: Headless will NOT hide most applications on OS X. Here is a detailed explanation


--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
 
watir-...@googlegroups.com
http://groups.google.com/group/watir-general
watir-genera...@googlegroups.com
 
---
You received this message because you are subscribed to the Google Groups "Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Eachus Lonny

unread,
May 6, 2013, 12:31:41 PM5/6/13
to watir-...@googlegroups.com

I feel that this most definitely deserves mention in the "headless" entry on watir-webdriver.com. A lot of Ruby developers use OS X and Firefox. The fact that I can't use headless may make things more difficult for me. I may be tempted to use Mechanize instead for this application, which would be a shame because I greatly prefer Watir.

So, then: what is the preferred method of using a headless browser with Watir on OS X? And: eventually, this application will likely be ported to Heroku. Is there a way to use a headless browser with Watir on Heroku?


Lonny Eachus
===========


On May 6, 2013, at 1:29 AM, watir-...@googlegroups.com wrote:

Group: http://groups.google.com/group/watir-general/topics


Oscar Rieken

unread,
May 6, 2013, 12:43:22 PM5/6/13
to watir-...@googlegroups.com
I use phantomjs to run headless If i need to 
Alister Scott wrote a good intro a while back


Eachus Lonny

unread,
May 6, 2013, 1:12:35 PM5/6/13
to watir-...@googlegroups.com

More Watir questions:

I used to use Watir extensively at work, but it has been a little while. Using watir-webdriver, does Watir remain updated when a page is changed via JavaScript, like the old Watir used to? This is rather important to my work.

If not: I need to know how to refresh Watir's snapshot of the DOM. If so, wonderful; I can use it as before.

I also notice that the old "attach" method is no longer available. Is there a way to attach a Watir browser instance to an existing browser window?


Lonny Eachus
===========

Željko Filipin

unread,
May 7, 2013, 6:04:35 AM5/7/13
to watir
On Mon, May 6, 2013 at 6:31 PM, Eachus Lonny <lon...@gmail.com> wrote:
I feel that this most definitely deserves mention in the "headless" entry on watir-webdriver.com.

We are looking for contributors. Please let me know if you would like to update the page.

Željko

Željko Filipin

unread,
May 7, 2013, 6:08:40 AM5/7/13
to watir
On Mon, May 6, 2013 at 7:12 PM, Eachus Lonny <lon...@gmail.com> wrote:
Using watir-webdriver, does Watir remain updated when a page is changed via JavaScript, like the old Watir used to?

I think so. Try and let us know if you experience any problems.
 
I also notice that the old "attach" method is no longer available. Is there a way to attach a Watir browser instance to an existing browser window?

No. There is a bug from 2009:


There is a way to attach to windows created by the script and javascript popups, if that would help:

Reply all
Reply to author
Forward
0 new messages