Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download into .hitchpkg directory and use a specified version of firefox #3

Open
crdoconnor opened this issue Apr 27, 2016 · 5 comments

Comments

@crdoconnor
Copy link
Contributor

  • In order to prevent errors caused by the selenium library being incompatible with versions of firefox newly upgraded by the system package manager.
  • To allow for replication of bugs caused by specific versions of firefox.

See : hitchtest/hitch#29

@badri
Copy link

badri commented Jul 14, 2016

Hi, I get the following error with the latest Hitch/Hitchselenium:

[        Err Firefox] Traceback (most recent call last):
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
[        Err Firefox]     "__main__", mod_spec)
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
[        Err Firefox]     exec(code, run_globals)
[        Err Firefox]   File "/home/lakshmi/cf/panel/tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 43, in <module>
[        Err Firefox]     run()
[        Err Firefox]   File "/home/lakshmi/cf/panel/tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 26, in run
[        Err Firefox]     firefox_binary=FirefoxBinary(firefox_path=sys.argv[1])
[        Err Firefox]   File "/home/lakshmi/cf/panel/tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
[        Err Firefox]     self.binary, timeout)
[        Err Firefox]   File "/home/lakshmi/cf/panel/tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
[        Err Firefox]     self.binary.launch_browser(self.profile, timeout=timeout)
[        Err Firefox]   File "/home/lakshmi/cf/panel/tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
[        Err Firefox]     self._wait_until_connectable(timeout=timeout)
[        Err Firefox]   File "/home/lakshmi/cf/panel/tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 99, in _wait_until_connectable
[        Err Firefox]     "The browser appears to have exited "
[        Err Firefox] selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

Did I miss any step?

@crdoconnor
Copy link
Contributor Author

No, this feature isn't finished yet so the system version of firefox is used by default. Unfortunately the latest version of selenium doesn't like the latest version of firefox.

If you downgrade the system firefox to the previous it it should work. Alternatively wait a few days and I will have a fix out (I will comment here when it's ready).

@badri
Copy link

badri commented Jul 14, 2016

Awesome, let me know if I can help in this regard.

@crdoconnor
Copy link
Contributor Author

crdoconnor commented Jul 15, 2016

Hi,

I've finished the feature. You can activate it by upgrading to the latest version -- 0.5.4- like so::

hitch install hitchselenium

Then, changing the code and putting this in your set up somewhere::

firefox_package = hitchselenium.FirefoxPackage()
firefox_package.build()

And adding the parameter firefox_binary to the service, e.g. like so::

self.services['Firefox'] = hitchselenium.SeleniumService(
        xvfb=self.settings.get("xvfb", False) or self.settings.get("quiet", False),
        no_libfaketime=True,
        firefox_binary=firefox_package.firefox,
)

If that works (and especially if it doesn't!), it'd be awesome if you could drop a note here letting me know.

This ought to work both on Mac and Linux.

@bodgerbarnett
Copy link

This worked for me - thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants