Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ThomasLandauer opened this issue Apr 24, 2022 · 4 comments
Open

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

ThomasLandauer opened this issue Apr 24, 2022 · 4 comments

Comments

@ThomasLandauer
Copy link
Member

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
Copy link
Member Author

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() :-(

@harshit-git
Copy link

harshit-git commented Nov 10, 2022

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

@danhi
Copy link

danhi commented Mar 8, 2023

Did this ever get resolved?

@mferretti
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants