我需要通过登录本地网站进行测试。这是Behat的测试功能:
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"
我正在通过Selenium Driver v2.33进行测试。我总是从驱动程序中得到错误,下面是控制台日志:
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.
这是selenium的日志:
..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..
这是我不明白的。它询问标题“唱歌”,或同样的id等,并告诉我没有这样的按钮。但它确实是这个按钮的HTML代码:
<a id="singin" role="button" data-toggle="modal" href="#signin_modal"> … </a>
答案 0 :(得分:1)
你应该使用
I follow "singin"
“我按”需要html按钮元素
<button></button>