Send keys not working selenium webdriver python

0 votes

I need to send text to description textarea. There is some predefined text which is cleared after click. I tried to use clear() or click() before sendkeys but nothing works correctly. It will send text there but it is still grey and after saving page there is error that tere is no text in description... Can I use something else instead of send keys? Thanks

Textarea looks like:

<textarea id="manage_description" class="eTextArea" name="e.description" cols="" rows="" onfocus="clearDescHint(this);" onblur="resetDescHint(this);" style="color: grey;"></textarea>

send_keys not working

self.driver.find_element_by_id('manage_description').send_keys("TEST")
Sep 28, 2018 in Selenium by Perry
• 17,100 points
17,723 views

1 answer to this question.

0 votes

As you mentioned send_keys("TEST") are not working, there are a couple of alternatives to send a character sequence to respective fields as mentioned below :

  1. Use Keys.NUMPAD3 [simulating send_keys("3")]:

    login.send_keys(Keys.NUMPAD3)
  2. Use JavascriptExecutor with getElementById :

    self.driver.execute_script("document.getElementById('login_email').value='12345'")
  3. Use JavascriptExecutor with getElementsById :

    self.driver.execute_script("document.getElementsById('login_password')[0].value='password'")

Hope this Helps!!

To learn more, join the online course to do Masters in Python.

Thanks!

answered Sep 28, 2018 by Meci Matt
• 9,460 points

Related Questions In Selenium

+2 votes
4 answers

sendKeys() not working in Selenium Webdriver

this work for me you should update your ...READ MORE

answered Aug 27, 2019 in Selenium by Afif
30,104 views
0 votes
1 answer

findElement(By.xpath()) not working using Selenium WebDriver

element = findElement(By.xpath("//*[@test-id='test-username']"); element = findElement(By.xpath("//input[@test-id='test-username']"); (*) - any ...READ MORE

answered Apr 18, 2018 in Selenium by code_ninja
• 6,300 points
9,263 views
+1 vote
2 answers

Drop-down menu option value not working using Selenium (Python)

from selenium.webdriver.support.select import Select inputElementG ...READ MORE

answered Nov 28, 2018 in Selenium by Rijhu mal
15,105 views
0 votes
1 answer

Send keys control + click in Selenium with Python bindings

Use an ActionChain with key_down to press the control key, and key_up to ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,460 points
12,799 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,576 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,087 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,181 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,841 views
0 votes
1 answer

Selenium WebDriver.get(url) not working

It is a Selenium defect. Problem is ...READ MORE

answered Jun 7, 2018 in Selenium by Meci Matt
• 9,460 points
9,143 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP