holden431 / browsershots

Automatically exported from code.google.com/p/browsershots
0 stars 0 forks source link

Chrome/Chromium support on Linux #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setup Chromium in a Linux shotfactory
2. When a job gets executed, shotfactory fails as follows:
============================== 02:44:13 ==============================
server poll latency: 1.91 seconds
{'major': 4, 'javascript': '', 'java': '', 'width': 1024, 'flash': '',
'request': 150505552, 'height': 768, 'bpp': 24, 'version': '4.0.249.43',
'command': 'chromium-browser', 'minor': 0, 'browser': 'Chrome'}
Traceback (most recent call last):
  File "shotfactory.py", line 368, in <module>
    _main()
  File "shotfactory.py", line 345, in _main
    bytes = browsershot(options, server, config, options.password)
  File "shotfactory.py", line 129, in browsershot
    gui_module = __import__(module_name, globals(), locals(), ['non-empty'])
ImportError: No module named chrome

What is the expected output? What do you see instead?
Chrome should get support on Linux screenfactories and such an ImportError
should not cause the screen factory to halt.

What version of the product are you using? On what operating system?
SVN trunk (http://browsershots.googlecode.com/svn/trunk/shotfactory) r3182

Original issue reported on code.google.com by dhahler@gmail.com on 2 Feb 2010 at 9:48

GoogleCodeExporter commented 8 years ago
This also happens on OSX

Original comment by therestr...@gmail.com on 15 Jun 2010 at 10:14

GoogleCodeExporter commented 8 years ago
Well, you could try copying a Safari or FF-module and edit it.

Original comment by home%xan...@gtempaccount.com on 19 Jun 2010 at 11:56

GoogleCodeExporter commented 8 years ago
Here's my chrome.py, put it into the shotfactory04/gui/linux/  folder.
Make sure chrome is in your PATH before you start shotfactory.

Another thing I found helpful was to change the gui/linux/__init__.py file 
where it says F10, change to F11.  That's if F11 is your maximize key, it 
usually is.

Original comment by nik...@gmail.com on 12 Jan 2011 at 5:53

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This is the one I use (see attached chrome.py) -

Another important thing to consider on Linux is that the command is 
chromium-browser. I modify the __init__.py to allow for lynx browser and 
chromium on linux. You just have to modify the start_browser function:

def start_browser(self, config, url, options):
        """
        Start browser and load website.
        """
        command = config['command'] or config['browser'].lower()
        if command == "lynx":
            command = 'xterm -maximized -e %s "%s" &' % (command, url)
        elif command == "chrome":
            command = 'chromium-browser --incognito --no-first-run --start-maximized "%s" &' % (url)
        else:
            command = '%s "%s" &' % (command, url)
        print "Running", command
        error = self.shell(command)
        if error:
            raise RuntimeError("could not start the browser")
        print "Sleeping %d seconds while page is loading." % options.wait
        time.sleep(options.wait - 10)
        self.maximize()
        time.sleep(10)

Original comment by jami...@gmail.com on 14 Mar 2011 at 5:32

Attachments: