Can behat log in as an administrator for testing while using LDAP?
I had this issue as well. It turned out to be a problem with LDAP. Switching to Mixed Mode allow the DrupalExtension to function properly. Since we don't want mixed by default, I added a pre-test setup function

public static function prepare($scope)
     {
        $data = array(
          'sids' =&gt; array (
            'directory' =&gt; 'directory',
          ),
          'authenticationMode' =&gt; 1,
          'loginConflictResolve' =&gt; 2,
          'acctCreation' =&gt; 4,
          'loginUIUsernameTxt' =&gt; NULL,
          'loginUIPasswordTxt' =&gt; NULL,
          'ldapUserHelpLinkUrl' =&gt; NULL,
          'ldapUserHelpLinkText' =&gt; 'Logon Help',
          'emailOption' =&gt; 3,
          'emailUpdate' =&gt; 1,
          'allowOnlyIfTextInDn' =&gt; array (),
          'excludeIfTextInDn' =&gt; array (),
          'allowTestPhp' =&gt; '',
          'excludeIfNoAuthorizations' =&gt; NULL,
          'ssoRemoteUserStripDomainName' =&gt; NULL,
          'seamlessLogin' =&gt; NULL,
          'ldapImplementation' =&gt; NULL,
          'cookieExpire' =&gt; NULL,

        );
        variable_set('ldap_authentication_conf', $data);
     }


The key is the line 'authenticationMode' =&gt; 1,