title: How to type like a human via Actionchains send_keys
body: <p>I know how to type slowly with the next code:</p>
  
  <pre><code>elem = driver.find_element_by_id("mainCommentForm")
  text = "To type text here"
  for character in text:
    elem.send_keys(character)
    time.sleep(random.uniform(0.2,0.5))
  </code></pre>
  
  <p>Unfortunately, the website where I work with does not allow to type text via the normal send_keys option, as it gives an error message. It is like I select the element, then I want to send_keys but it cannot find the element as it is deselected or something. It has something to do with typing in Java. Please do not ask why this is not working as that is not my question..</p>
  
  <p>Fact is, I need to use the Actionchains send_keys option as seen below.
  But how do I simulate typing as a human now, same as example above?
  By human typing I mean typing it in letter by letter instead of just copy/paste..</p>
  
  <pre><code>elem = driver.find_element_by_id("mainCommentForm")
  actions = ActionChains(driver)
  actions.move_to_element(elem)
  actions.click()
  actions.send_keys("This text must be typed in slower..")
  actions.perform()
  </code></pre>