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

Support renamed Chrome.app on macOS #92

Open
finngaida opened this issue Aug 13, 2022 · 1 comment
Open

Support renamed Chrome.app on macOS #92

finngaida opened this issue Aug 13, 2022 · 1 comment

Comments

@finngaida
Copy link

I got an error when launching helium via driver = start_chrome():

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

After some trial and error I noticed Chrome gets installed into /Applications/Google Chrome.app by default, however I had renamed it to just Chrome.app, presumably breaking the binary lookup functionality of helium.
It was easily fixed by linking Chrome to the expexted path via ln -s /Applications/Chrome.app /Applications/Google\ Chrome.app -however an API access à la driver = start_chrome(binary_path="/Applications/Chome.app") would be preferable.

@everythingability
Copy link

Cursor_and_Google

I'm on macos too... and when I run the example script I first have to accept cookies. I hacked the code to wait a bit like this..

import helium
from time import sleep
# See: https://github.com/mherrmann/helium/blob/master/docs/cheatsheet.md

print(dir(helium))

print("Starting chrome...")
helium.start_chrome('google.com')
sleep(5)
print("Continuing... searching for helium")
helium.write('helium selenium github')
helium.press(helium.ENTER)
helium.click('mherrmann/helium')
helium.go_to('github.com/login')
helium.write('username', into='Username')
helium.write('password', into='Password')
helium.click('Sign in')
helium.kill_browser()

Then... it errors like this...

  File "/Users/tas509/helium_chrome/example.py", line 13, in <module>
    helium.click('mherrmann/helium')
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/Users/tas509/helium_chrome/env/lib/python3.13/site-packages/helium/__init__.py", line 280, in click
    _get_api_impl().click_impl(element)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/tas509/helium_chrome/env/lib/python3.13/site-packages/helium/_impl/__init__.py", line 177, in click_impl
    self._perform_mouse_action(element, self._click)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tas509/helium_chrome/env/lib/python3.13/site-packages/helium/_impl/__init__.py", line 36, in f_decorated
    result = f(self, *args, **kwargs)
  File "/Users/tas509/helium_chrome/env/lib/python3.13/site-packages/helium/_impl/__init__.py", line 55, in f_decorated
    return f(*args, **kwargs)
  File "/Users/tas509/helium_chrome/env/lib/python3.13/site-packages/helium/_impl/__init__.py", line 219, in _perform_mouse_action
    self._manipulate(element, lambda wew: action(wew.unwrap(), offset))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tas509/helium_chrome/env/lib/python3.13/site-packages/helium/_impl/__init__.py", line 285, in _manipulate
    driver.last_manipulated_element = gui_or_web_elt.perform(action)
                                      ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/Users/tas509/helium_chrome/env/lib/python3.13/site-packages/helium/_impl/__init__.py", line 641, in perform
    raise LookupError()
LookupError

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

2 participants