diff --git a/vividus-plugin-web-app/src/main/java/org/vividus/ui/web/action/MouseActions.java b/vividus-plugin-web-app/src/main/java/org/vividus/ui/web/action/MouseActions.java index d02b438957..daecbd2499 100644 --- a/vividus-plugin-web-app/src/main/java/org/vividus/ui/web/action/MouseActions.java +++ b/vividus-plugin-web-app/src/main/java/org/vividus/ui/web/action/MouseActions.java @@ -71,7 +71,13 @@ private void tryToWorkaroundException(WebElement element, ClickResult clickResul WebElement page, WebDriverException webDriverException) { String message = webDriverException.getMessage(); - if (message.contains("is not clickable at point") && message.contains("Other element would receive the click")) + /* + - Element is overlapped with another one: Other element would receive the click + - Page has dynamically loaded content which results in invalid (sometimes negative) coordinates for click, e.g: + Element is not clickable at point (498, -377) + Element is not clickable at point (550, -11228) + */ + if (message.contains("is not clickable at point")) { try { diff --git a/vividus-plugin-web-app/src/test/java/org/vividus/ui/web/action/MouseActionsTests.java b/vividus-plugin-web-app/src/test/java/org/vividus/ui/web/action/MouseActionsTests.java index 71b737def9..200edd03d7 100644 --- a/vividus-plugin-web-app/src/test/java/org/vividus/ui/web/action/MouseActionsTests.java +++ b/vividus-plugin-web-app/src/test/java/org/vividus/ui/web/action/MouseActionsTests.java @@ -241,17 +241,6 @@ void shouldNotRetryClickOnMatchingError() testClickWithElementNotClickableException(); } - @Test - void shouldNotRetryClickOnNonMatchingError() - { - mockBodySearch(); - - WebDriverException e = new WebDriverException(ELEMENT_IS_NOT_CLICKABLE_AT_POINT); - doThrow(e).doNothing().when(webElement).click(); - WebDriverException exception = assertThrows(WebDriverException.class, () -> mouseActions.click(webElement)); - assertThat(exception.getMessage(), containsString(ELEMENT_IS_NOT_CLICKABLE_AT_POINT)); - } - private WebElement mockBodySearch() { when(webDriverProvider.get()).thenReturn(webDriver);