user1117498
user1117498

Reputation: 29

Send keys not working in selenium with python

send keys are not working in selenium with python. This was working earlier but it fails now. I don't know what may be the issue . It gives following error :

u"Element is disabled and so may not be used
for actions\nCommand duration or timeout: 11             
milliseconds\nBuild info: version: '2.15.0', revision: '15105', time:
'2011-12-08   09:56:25'\nSystem info: os.name: 'Windows 7', os.arch:
'amd64', os.version: '6.1',    java.version: '1.6.0_22'

I have used below along with time.sleep(3) before passing keys

elem.send_keys('selenium')   
elem.send_keys(Keys.RETURN)    

Also

elem.send_keys("Sale" + Keys.RETURN)   

But nothing works

Upvotes: 1

Views: 3353

Answers (2)

Jesse Costales
Jesse Costales

Reputation: 11

I noticed this also. find_element_by_* returns a list. A quick fix is to use the first element, i.e. elem[0].send_keys(text).

Upvotes: 1

0xc0de
0xc0de

Reputation: 8287

As the error says, the element is disabled and hence you(a user using a browser, selenium tries to mimic such a user) can not interact with that element.

Upvotes: 1

Related Questions