Codeception / module-webdriver

WebDriver module for Codeception
MIT License
36 stars 25 forks source link

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

Open ThomasLandauer opened 2 years ago

ThomasLandauer commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

Did this ever get resolved?

mferretti commented 7 months ago

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 `

org.seleniumhq.selenium selenium-java 4.19.1

`