title: Cannot press more then one button or an already pressed button Selenium
body: <p>I'm using this code to move element by offset</p>
  
  <pre><code>Actions builder = new Actions(driver);
        builder.moveToElement(element).clickAndHold(element).moveByOffset(xOffset,yOffset).perform();
  </code></pre>
  
  <p>It works fine when only used once but when I make it a function</p>
  
  <pre><code>public void fun(int xOffset,int yOffset, String elementId){
         WebElement element = driver.findElement(By.id(id));
         Actions builder = new Actions(driver);
         builder.moveToElement(element).clickAndHold(element).moveByOffset(xOffset,yOffset).perform();
  }
  fun(100,0,"main_element");
  fun(0,100,"main_element");
  </code></pre>
  
  <p>And call it with multiple elements I get the error <code>Cannot press more then one button or an already pressed button</code></p>