Anubira
Anubira

Reputation: 49

AttributeError: 'selenium' object has no attribute 'send_keys' with Selenium and Python

I created my selenium IDE test, I exported the test to Python 2 Remote control. When I run the script it gives me this error:

[root@localhost python]# ./check_selenium.py -s pruebas -w 40 -c 60
SELENIUM UNKNOWN FAIL: not all tests passed -> pruebas  | E
======================================================================
ERROR: test (__main__.test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pruebas", line 21, in
    sel.send_keys("id=buscador", "3")
AttributeError: 'selenium' object has no attribute 'send_keys'

----------------------------------------------------------------------
Ran 1 test in 59.428s

Can not use keys with Remote control?

this is my line:

 sel.send_keys("id=buscador", "3")

Regards

Upvotes: 1

Views: 489

Answers (1)

finefoot
finefoot

Reputation: 11282

According to the Selenium docs, send_keys does not prive that kind of call. I think, you need to find the element object with find_element_by_id, first. Then call send_keys of that object.

sel.find_element_by_id("buscadorReferencia_widget").send_keys("8090393")

(This assumes, that sel is your web driver object.)

Upvotes: 2

Related Questions