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.