diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php index 917a4a47..e74fcb3a 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -978,12 +978,14 @@ public function dragTo(string $sourceXpath, string $destinationXpath) element.dispatchEvent(event); }({{ELEMENT}})); JS; - $this->withSyn()->executeJsOnElement($source, $script); + $this->executeJsOnElement($source, $script); $this->getWebDriverSession()->buttondown(); - $this->getWebDriverSession()->moveto(array( - 'element' => $destination->getID() - )); + if ($destination->getID() !== $source->getID()) { + $this->getWebDriverSession()->moveto(array( + 'element' => $destination->getID() + )); + } $this->getWebDriverSession()->buttonup(); $script = <<withSyn()->executeJsOnElement($destination, $script); + $this->executeJsOnElement($destination, $script); } public function executeScript(string $script)