4

Background: Flask app on Heroku. Python 3.4 in venv. I'm using the Selenium webdriver (2.53.2) Here's the traceback:

The desired behavior is for it to send the keys to the value of the web element.

The specific problem or error:

WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.CSS_SELECTOR, "#onyen"))
    ).send_keys(onyen)

The traceback is

Traceback (most recent call last):
  File "driver.py", line 332, in <module>
    to_shopping_cart(phantom=True)
  File "driver.py", line 47, in to_shopping_cart
    ).send_keys(onyen)
  File "/app/.heroku/python/lib/python3.4/site-packages/selenium/webdriver/remote/webelement.py", line 322, in send_keys
    self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': keys_to_typing(value)})
  File "/app/.heroku/python/lib/python3.4/site-packages/selenium/webdriver/remote/webelement.py", line 457, in _execute
    return self._parent.execute(command, params)
  File "/app/.heroku/python/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 233, in execute
    self.error_handler.check_response(response)
  File "/app/.heroku/python/lib/python3.4/site-packages/selenium/webdriver/remote/errorhandler.py", line 165, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: TypeError - undefined is not a function (evaluating '_getTagName(currWindow).toLowerCase()')

I have no idea how to fix this traceback, after opening all the files listed.

Here is the shortest code necessary to reproduce the question itself, provided you're in a venv of python 3.4 with selenium 2.53.2

from selenium import webdriver
driver = webdriver.PhantomJS() # webdriver.Firefox() works no problem
driver.get("https://sso.unc.edu/idp/Authn/UserPassword")
WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.CSS_SELECTOR, "#onyen"))
    ).send_keys(onyen)

It is important to note that the same error is thrown on Heroku bash and my own machine, however on my own machine the file paths start with /venv/python3.4 instead of /.heroku/python/lib/python3.4.

Moshe Slavin
  • 5,127
  • 5
  • 23
  • 38
Derek Fulton
  • 306
  • 1
  • 14
  • Have you tried upgrading both `selenium` and `PhantomJS` to the latest versions? Thanks. – alecxe Jun 06 '16 at 00:13
  • @Derek - What code is this error against? – Naman Jun 06 '16 at 03:46
  • @alecxe I have upgraded both of them to the latest versions (selenium 2.53.2 which includes phantomjs in "PhantomJS()" webdriver) – Derek Fulton Jun 06 '16 at 14:38
  • @nullpointer I have included the minimal code which the error is against. The error stems from the send_keys method of a web element which I selected by ID. the object is a selenium webelement object. – Derek Fulton Jun 06 '16 at 14:39

0 Answers0