From afa138baf792b0128fc8de2f7e3c238b42e6e6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 17 Oct 2022 13:23:47 +0200 Subject: [PATCH] No WebDriver\Session::moveto() call when dragging over itself --- src/Selenium2Driver.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php index a399c354..d9b09546 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -934,9 +934,11 @@ public function dragTo($sourceXpath, $destinationXpath) $this->executeJsOnElement($source, $script); $this->wdSession->buttondown(); - $this->wdSession->moveto(array( - 'element' => $destination->getID() - )); + if ($destination->getID() !== $source->getID()) { + $this->wdSession->moveto(array( + 'element' => $destination->getID() + )); + } $this->wdSession->buttonup(); $script = <<