user1499804
user1499804

Reputation: 257

Behat's "When I press..." doesn't work with Selenium 2.33

I need to make a test with logging in my local website. Here is Behat's test feature:

    Feature: test
    In order to log in
    As a test user
    I need to get positive results


@javascript
Scenario: Logging in using Behat
    Given I am on "/app_dev.php/"
    When I press "singin"
    Then I should see "Sign in now"

I am testing by Selenium Driver v2.33. I always get an error from driver, below is console log:

Unexpected response from Selenium server : ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window.  The error message is: Value does not implement interface Event.

And this is selenium's log:

..18:27:58.626 INFO - Command request: click[xpath=(//html/.//a[./@href][(((./@id = 'singin' or contains(normalize-space(string(.)), 'singin')) or contains(./@title, 'singin')) or .//img[contains(./@alt, 'singin')])] | .//*[./@role = 'link'][((./@id = 'singin' or contains(./@value, 'singin')) or contains(./@title, 'singin') or contains(normalize-space(string(.)), 'singin'))])[1], ] on session cc4ec3ebb5084d5ba518168f54be332e..

And this is what I don't understand. It asks a title "singin", or same id etc and tells me that there is no such buttons. But it is and this is my chunk of HTML code of that button:

<a id="singin" role="button" data-toggle="modal" href="#signin_modal"> … </a>

Upvotes: 0

Views: 557

Answers (1)

Vail
Vail

Reputation: 608

You should use

I follow "singin"

"I press" require html button element

<button></button>

Upvotes: 1

Related Questions