16

I'm trying to pass through "ENTER" to a text field, using Selenium (Python). The text box requires that each phone number be entered on a new line, so it will look something like:

#Add the phone number#
Webelement.sendKeys(Keys.ENTER)

I've imported the following library:

from selenium.webdriver.common.keys import Keys

The problem I'm getting is that it fails with:

AttributeError: 'WebElement' object has no attribute 'sendKeys'

Does anyone know how to resolve this? I've been searching for a solution, but haven't been able to find anything.

1
  • The very first example in the selenium documentation should help. Also, a google search for python selenium sendkeys provides all sorts of useful hints as to the problem ... Commented Jul 22, 2016 at 8:09

1 Answer 1

50

Try using WebElement::send_keys() instead of sendKeys as below :-

from selenium.webdriver.common.keys import Keys

Webelement.send_keys(Keys.ENTER)
Sign up to request clarification or add additional context in comments.

1 Comment

I think it should be WebElement.send_keys() insted of WebElement::send_keys()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.