From afbf74641d6965fa08a7b5a8b7b9de4ad3069ce8 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 6d88301a..5c931950 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -930,9 +930,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 = <<