Is there a way to assert that an element (e.g. input or link) has the keyboard focus? I'm using Codeception with Selenium. Couldn't find anything on http://codeception.com/docs/modules/WebDriver
Is there a way to assert that an element (e.g. input or link) has the keyboard focus? I'm using Codeception with Selenium. Couldn't find anything on http://codeception.com/docs/modules/WebDriver
To complete the @sunomad's answer. If you use the code line :
$I->executeJS('return $("#element").is(":focus")');
You got this error :
[Facebook\WebDriver\Exception\UnknownServerException] unknown error: $ is not a function
Switch $ by jQuery
$I->executeJS('return jQuery("#element").is(":focus")');
And it works !