Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium + Firefox Dev-Edition: send_keys throwing [object Undefined] exception

Trying to input username during login using send_keys() method. I guess it's able to locate the input element, as when I run until before send_keys it works. With sending a string value in send_keys, it's throwing an error.

selenium.common.exceptions.WebDriverException: Message: Expected [object Undefined] undefined to be a string

What am I missing?

Python : 3.5
Selenium 3.3.1
Firefox Developer Edition or Nightly (currently version > 52)
My code snippet:

login_url = "https://korunet.co.nz/"
driver = webdriver.Firefox()
driver.get(login_url)
WebDriverWait(driver, 30).until(ec.visibility_of_element_located((By.CSS_SELECTOR, '#IDToken1')))

elem = driver.find_element_by_css_selector('#IDToken1')
elem.click()
elem.clear()
elem.send_keys("10101")

Traceback (most recent call last):

File "D:/PycharmProjects/JCBbidEntry/tests/loop2.py", line 29, in elem.send_keys("10101")
File "C:\Users\BaruaR\AppData\Roaming\Python\Python35\site-packages\selenium\webdriver\remote\webelement.py", line 347, in send_keys self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': keys_to_typing(value)})
File "C:\Users\BaruaR\AppData\Roaming\Python\Python35\site-packages\selenium\webdriver\remote\webelement.py", line 491, in _execute return self._parent.execute(command, params)
File "C:\Users\BaruaR\AppData\Roaming\Python\Python35\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in execute self.error_handler.check_response(response)
File "C:\Users\BaruaR\AppData\Roaming\Python\Python35\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
raise exception_class(message, screen, stacktrace)

like image 717
user1751844 Avatar asked Apr 03 '17 00:04

user1751844


3 Answers

Appears to be resolved, at least for me with the latest version of geckodriver 0.16: https://github.com/mozilla/geckodriver/releases/tag/v0.16.0

Note that version 0.16 requires selenium 3.4.

-Erinn

like image 93
Erinn Looney-Triggs Avatar answered Nov 19 '22 16:11

Erinn Looney-Triggs


Same here ... Seems to be a problem with FIREFOX ... it works as expected with CHROME ;-(

like image 3
manatlan Avatar answered Nov 19 '22 16:11

manatlan


i have also same problem in my case my geckodriver is 64bit but firefox is 32 bit it throws an error

like image 2
user7853955 Avatar answered Nov 19 '22 17:11

user7853955