Answer the question
In order to leave comments, you need to log in
How to fix element not interactable error?
I use Chrome Driver (Yii2 framework), I run this command
D:\ChromeDriver\chromedriver.exe --url-base=/wd/hub
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://arctic/
window_size: false # disabled in ChromeDriver
port: 9515
browser: chrome
- Yii2:
part: orm
entryScript: index-test.php
cleanup: false
public function _before(AcceptanceTester $I)
{
$I->amOnPage('/admin');
$I->fillField('FormLogin[username]', 'admin');
$I->fillField('FormLogin[password]', 'admin');
$I->click('Войти');
$I->click('Меню');
}
1) AdminMenuAcceptCest: Try to test
Test tests\acceptance\AdminMenuAcceptCest.php:tryToTest
[Facebook\WebDriver\Exception\ElementNotInteractableException] element not interactable
(Session info: chrome=80.0.3987.100)
Scenario Steps:
2. $I->fillField("FormLogin[username]","admin") at tests\acceptance\AdminMenuAcceptCest.php:8
1. $I->amOnPage("/admin/main") at tests\acceptance\AdminMenuAcceptCest.php:7
#1 D:\OSPanel-new\domains\arctic_dev\vendor\php-webdriver\webdriver\lib\Exception\WebDriverException.php:95
#2 D:\OSPanel-new\domains\arctic_dev\vendor\php-webdriver\webdriver\lib\Remote\HttpCommandExecutor.php:370
#3 D:\OSPanel-new\domains\arctic_dev\vendor\php-webdriver\webdriver\lib\Remote\RemoteWebDriver.php:584
#4 D:\OSPanel-new\domains\arctic_dev\vendor\php-webdriver\webdriver\lib\Remote\RemoteExecuteMethod.php:27
#5 D:\OSPanel-new\domains\arctic_dev\vendor\php-webdriver\webdriver\lib\Remote\RemoteWebElement.php:60
#6 Codeception\Module\WebDriver->fillField
#7 D:\OSPanel-new\domains\arctic_dev\tests\_support\_generated\AcceptanceTesterActions.php:1505
#8 D:\OSPanel-new\domains\arctic_dev\tests\acceptance\AdminMenuAcceptCest.php:8
#9 AdminMenuAcceptCest->_before
Answer the question
In order to leave comments, you need to log in
The error occurs due to JS that does not have time to work out (or does not work out at all), adding this code solved the problem
$I->executeInSelenium(function(RemoteWebDriver $webdriver) {
$webdriver->executeScript("$('#login_block').modal('show');");
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question