Python Forum
How to send keys at beginning of textbox using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to send keys at beginning of textbox using python
#2
Hello, so if I understand your problem correctly, you want to keep the text in the textarea but enter some string at the beginning:
data_reference = driver.find_element_by_xpath('//*[@id="editdetails_frm"]/table/tbody/tr[24]/td[3]/textarea'+"\n")

text_in_textarea = data_reference.text
data_reference.clear()
data_reference.send_keys(str(ele[1]) + text_in_textarea)

data_reference1 = driver.find_element_by_xpath('//*[@id="edit_detail[22]"]')
data_reference1.click()
I think you just need to save the text that's already in, clear the textarea and enter your string together with the text that was there before.
Reply


Messages In This Thread
RE: How to send keys at beginning of textbox using python - by mlieqo - May-21-2018, 07:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send unicode string encoded in utf-8 in http request in Python MaverinCode 1 32,642 Nov-08-2020, 06:45 AM
Last Post: JaiM
  Send Keys Error? AgileAVS 0 1,616 Oct-06-2020, 07:53 AM
Last Post: AgileAVS
  Code example for entering input in a textbox with requests/selenium object peterjv26 1 1,737 Sep-26-2020, 04:34 PM
Last Post: Larz60+
  Just beginning with Selenium JLogan3o13 2 1,900 Mar-22-2020, 05:25 PM
Last Post: JLogan3o13
  Python Rest API Public/Secret Keys Authentication Nonce dn237 1 2,939 Oct-31-2019, 02:07 AM
Last Post: dn237

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020