title: How to move visible mouse pointer using selenium web driver?
body: <p>I am new to Selenium. 
  I am using <a href="https://www.gridlastic.com/" rel="nofollow noreferrer">gridlastic</a> as test environment.</p>
  
  <p>I have gone through Actions class for selenium which has methods to move mouse as well as got the mouse instance via web driver by calling getMouse() and tried to move the mouse but dint succeed. </p>
  
  <pre><code>@Test(enabled = true)
       public void test_site() throws Exception  {    
           Coordinates elementLocation = null;
          driver.get("https://www.amazon.com");
  
          Mouse mouse = ((HasInputDevices) driver).getMouse();
          System.out.println(mouse.toString());
          if(mouse==null) {
              System.out.println("mouse is null");    
          }
          WebElement element1=driver.findElementByXPath("//*[@id=\"a-autoid-0-announce\"]");
          elementLocation = ((Locatable) element1).getCoordinates();
          mouse.mouseMove(elementLocation);
  
          Thread.sleep(5000); //slow down for demo purposes
  
  
      }
  </code></pre>
  
  <p>Also tried using the actions class as well</p>
  
  <pre><code>@Test(enabled = true)
       public void test_site() throws Exception  {    
          driver.get("https://www.google.com/ncr");
          Actions builder = new Actions(driver);
  
          builder.
             moveByOffset( 100, 1 )
             .build().perform();
          Thread.sleep(10000); //slow down for demo purposes
          WebElement element = driver.findElement(By.name("q"));
          element.sendKeys("webdriver");
          element.submit();
          Thread.sleep(5000); //slow down for demo purposes
      }
  </code></pre>
  
  <p>Still dint succeed , the mouse pointer remains at position (0,0) always. Can anyone help how to do it. </p>
  
  <p><a href="https://i.stack.imgur.com/HhHej.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HhHej.png" alt="enter image description here"></a>
  Please don't suggest using Robot Class from JAVA as the test environment is gridlastic and it doesn't work for it.</p>
  
  <p>I also tried using the javascript executor, but its not possible as mouse cursor is controlled by operating system. I thought of changing values of window object clientX and clientY , but those are readonly as per documentation.</p>