title: Alternative to Robot class (selenium script with linux)
body: <p>Is there any alternative to the Robot class that works in Linux to imitate the mouse movements like copy/paste?</p>
  <p>The following code works in windows but not in Linux OS. Can anyone please suggest if there is any alternate way to do the same in linux. Thank you.</p>
  <pre><code>System.setProperty(&quot;java.awt.headless&quot;, &quot;false&quot;);
  StringSelection ss = new StringSelection(fileName);
  Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
  Robot robot = new Robot();
  robot.delay(250);
  robot.keyPress(KeyEvent.VK_ENTER);
  robot.keyRelease(KeyEvent.VK_ENTER);
  robot.keyPress(KeyEvent.VK_CONTROL);
  robot.keyPress(KeyEvent.VK_SHIFT);
  robot.keyPress(KeyEvent.VK_V);
  robot.keyRelease(KeyEvent.VK_V);
  robot.keyRelease(KeyEvent.VK_SHIFT);
  robot.keyRelease(KeyEvent.VK_CONTROL);
  robot.keyPress(KeyEvent.VK_ENTER);
  robot.delay(90);
  robot.keyRelease(KeyEvent.VK_ENTER);
  </code></pre>