From 663bfb2b32c272135cc2b76eb5a0db3327d12b67 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 4cee5921..6d3325a9 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -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 = <<