send_keys to hidden elements

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

send_keys to hidden elements

swan yam
I want to send a text to a text box of a page.

 Here is hidden element on page from salesforce:

     <textarea class="chatterTopicsEnabled groupAtMentionsEnabled publishertextarea" 
      id="publishereditablearea" 
      name="publishereditablearea" 
      role="textbox" tabindex="0" 
      title="Topics" type="text" wrap="soft" 
      data-uidsfdc="112" style="height: 208px;">Topics</textarea>
      <input type="hidden" id="publisherprompttext" name="publisherprompttext" value="Topics">

My code by which i can click the text box but can do nothing to send text: 

    textbox = [tag for tag in driver.find_elements_by_tag_name('textarea') 
               if tag.get_attribute('name') == 'publishereditablearea']
    textbox[0].click()
    textbox[0].send_keys("text")

The error message said: `element not visible.`

How can I send a text to the textbox?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/d79cb562-7118-4076-8f2d-0b5c4c4710f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: send_keys to hidden elements

Xiang Dong

it is a wrong case to send text to a hidden element because you can't do it manually, but you can use execute javascript in webdriver for this purpose.


--david




From: [hidden email] <[hidden email]> on behalf of swan yam <[hidden email]>
Sent: Friday, November 24, 2017 7:05 PM
To: Selenium Users
Subject: [selenium-users] send_keys to hidden elements
 
I want to send a text to a text box of a page.

 Here is hidden element on page from salesforce:

     <textarea class="chatterTopicsEnabled groupAtMentionsEnabled publishertextarea" 
      id="publishereditablearea" 
      name="publishereditablearea" 
      role="textbox" tabindex="0" 
      title="Topics" type="text" wrap="soft" 
      data-uidsfdc="112" style="height: 208px;">Topics</textarea>
      <input type="hidden" id="publisherprompttext" name="publisherprompttext" value="Topics">

My code by which i can click the text box but can do nothing to send text: 

    textbox = [tag for tag in driver.find_elements_by_tag_name('textarea') 
               if tag.get_attribute('name') == 'publishereditablearea']
    textbox[0].click()
    textbox[0].send_keys("text")

The error message said: `element not visible.`

How can I send a text to the textbox?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/d79cb562-7118-4076-8f2d-0b5c4c4710f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/SINPR03MB223764A1D7A63B04F021730A90250%40SINPR03MB2237.apcprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.