Skip to content

Commit

Permalink
Added EventFiringWebElement to the isinstance check in the move_to me…
Browse files Browse the repository at this point in the history
…thod.

The isinstance check will now look for WebElement or EventFiringWebElement.
This will fix cases where the move_to() method in ActionChains will
throw AttributeErrors when using EventFiringWebDriver.

Fixes #6604
  • Loading branch information
Kyle McGonagle authored and AutomatedTester committed Jun 27, 2019
1 parent 0ed1e0b commit 3eeb405
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion py/selenium/webdriver/common/actions/pointer_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .pointer_input import PointerInput

from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.event_firing_webdriver import EventFiringWebElement


class PointerActions(Interaction):
Expand All @@ -38,7 +39,7 @@ def pointer_up(self, button=MouseButton.LEFT):
self._button_action("create_pointer_up", button=button)

def move_to(self, element, x=None, y=None):
if not isinstance(element, WebElement):
if not isinstance(element, (WebElement, EventFiringWebElement)):
raise AttributeError("move_to requires a WebElement")
if x is not None or y is not None:
el_rect = element.rect
Expand Down

0 comments on commit 3eeb405

Please sign in to comment.