module-webdriver icon indicating copy to clipboard operation
module-webdriver copied to clipboard

Error: Element <...> could not be scrolled into view

Open ThomasLandauer opened this issue 2 years ago • 4 comments

I'm "suddenly" getting this in many tests in Firefox (haven't tried with Chrome yet):

[Facebook\WebDriver\Exception\ElementNotInteractableException] Element <...> could not be scrolled into view

Is anybody else observing this? My current workaround: What used to be just $I->click(...); is now:

$I->scrollTo('someNearbyElement');
$I->wait(0.5); // Some arbitrary number. I tried with `$I->waitForElementClickable()` but it isn't working :-(
$I->click(...);

geckodriver 0.30.0 with Firefox 99.0

ThomasLandauer avatar Apr 24 '22 19:04 ThomasLandauer

This seems to be a new "feature" of WebDriver, cause with Chrome I'm getting:

[Facebook\WebDriver\Exception\ElementClickInterceptedException] element click intercepted: Element is not clickable at point (187, 2776)

SmartWait isn't working; so it looks like I have to manually add scrollTo() and wait() before each click() :-(

ThomasLandauer avatar Apr 26 '22 15:04 ThomasLandauer

I am having the same issue with the Robot framework. I have to wait for a few seconds before I can click the element (see below code):-

Wait Until Page Contains Element //button[@method='wallet'] Scroll To Element //button[@method='wallet'] Sleep 4s Click Element //button[@method='wallet']

Could this be a selenium issue than framework specific? @ThomasLandauer

harshit-git avatar Nov 10 '22 12:11 harshit-git

Did this ever get resolved?

danhi avatar Mar 08 '23 20:03 danhi

Same here.

<div style="text-align: center;"><input name="toggleCategoria" type="radio" id="ISCRIZIONE" value="ISCRIZIONE" style=""> <label for="ISCRIZIONE"></label></div>

I can easily select it by id:

WebElement element = new FluentWait<WebDriver>(driver)
                .withTimeout(Duration.ofSeconds(waitSecondsTimeout))
                .pollingEvery(Duration.ofMillis(300))
            .until(ExpectedConditions.presenceOfElementLocated(By.id("ISCRIZIONE")))

but If I click on

                if( element != null) {
                    element.click();
                    return true;
                }

it I get

Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: Element <input id="ISCRIZIONE" name="toggleCategoria" type="radio"> could not be scrolled into view

I am using latest stable Selenium from Maven Central <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.19.1</version> </dependency>

mferretti avatar Apr 10 '24 14:04 mferretti