Search code examples
firefoxunixseleniumheadless

Programmatically remove Firefox's license agreement dialog


I am running regression tests with Selenium and am automatically launching instances of Firefox.

The problem is my tests get stuck because of Firefox's license agreement dialog:

Copyright notice http://img151.imageshack.us/img151/3467/31963141.png.

I can't click with the mouse because I am in an headless environment with a virtual graphical environment.

I would like to know what Firefox's file can I edit (and how to edit it) to trick Firefox into thinking somebody accepted the copyright.

Clarification following comments

I need to do it just once. But I can't do it with the mouse as this is a virtual graphic environment and I don't have mouse or see the mouse pointer. I can however take screenshots.


Solution

  • OK, I found it by myself in the end.

    The right answer is:

    In the Firefox installation, look for firefox.js

    Find this line:

    pref("browser.EULA.3.accepted", false);

    and replace false whit true

    Thanks to all that helped.