Skip to content

Commit

Permalink
No WebDriver\Session::moveto() call when dragging over itself
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Apr 1, 2024
1 parent 6add71c commit 663bfb2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,11 @@ public function dragTo(string $sourceXpath, string $destinationXpath)
$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 = <<<JS
Expand Down

0 comments on commit 663bfb2

Please sign in to comment.