title: Python Selenium script drops keys but only when used on a VNC
body: <p>Setup:</p>
  
  <ul>
  <li>Windows 10 machine with a VNC connection to a Debian machine </li>
  <li>VNC Viewer 5.3.3 on Windows </li>
  <li>vncserver (Xvnc version TightVNC-1.3.9)
  on Debian</li>
  </ul>
  
  <p>I have a Python/Selenium/Chromedriver script on the Debian machine that does data entry to text boxes on a web page.  The code that is failing is very simple:</p>
  
  <pre><code>element = browser.find_element_by_path('//input[@name="ReqDocID"]')
  element.clear()
  element.send_keys(doc_id) # doc_id is a 3 character string
  </code></pre>
  
  <p>When I set up a VNC session to Debian from the Windows machine and run the script from an xterm on the X-windows desktop, characters in doc_id are randomly dropped.  Adding delays between entries did not make any difference.  The web page does not modify the contents of the text box during entry using JS.  The problem occurs using both Chrome and headlesschrome.  I verified that I had a new version of chromedriver (<a href="https://bugs.chromium.org/p/chromedriver/issues/detail?id=435" rel="nofollow noreferrer">fixed a drop key issue</a>) and that my keyboard is set for English to avoid another known issue.</p>
  
  <p>Finally after several hours of troubleshooting I found something interesting.  If I use Putty on the Windows box to ssh into Debian directly (no X-windows, no VNC) and then run the script it works perfectly.  When I run the same script from the VNC desktop it fails every time due to characters being dropped.</p>
  
  <p>Does anyone have an idea why running the script over a VNC connection should make a difference?  Thanks!</p>