0

I have troubles executing a behat/mink test routine in the browser. I have tried sahi and selenium divers, the result is the same:

I run the test, sahi opens the login modal-popup, but does not fill in username and password. Clicking "submit" does work again, but due to the missing username and password the user is not logged in ("wrong username/password" message is shown).

Now the questions:

  • Does anyone have an idea why this might happen and what I can do to get the issue fixed
  • Can someone tell me how to slow down execution in the browser (its very hard to follow)
  • Any more ideas on how to debug issues which occur during execution of the test scripts?

my feature step for loging in:

    /**
     * @Given /^I am logged in as "([^"]*)"$/
     */
    public function iAmLoggedInAs($username)
    {
        $user = $this->getUserFromUsername($username);
        $this->clickLink('Login');
        $this->fillField('_username',$user->getEmail());
        $this->fillField('_password','12341234');
        $this->pressButton('_submit');
        $this->loggedInUser = $user;
    }

html of the page:

http://pastebin.com/Mb5a0xnq

1 Answer 1

1

Fields parameters should be either field labels (actual text, not id) or field names.

so solution to your problem is to either use:

$this->fillField('_username',$user->getEmail());
$this->fillField('_password','12341234');

or

$this->fillField('E-Mail',$user->getEmail());
$this->fillField('Passwort:','12341234');
2
  • finding the fields is not the issue here- if that would be the problem I would get another error message (could not find field...) fields are found, but not filled.
    – stoefln
    May 18, 2012 at 12:17
  • yeah i did- didnt change anything.
    – stoefln
    May 19, 2012 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.