Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用behat和selenium2获取状态响应_Selenium_Behat_Acceptance Testing_Mink - Fatal编程技术网

使用behat和selenium2获取状态响应

使用behat和selenium2获取状态响应,selenium,behat,acceptance-testing,mink,Selenium,Behat,Acceptance Testing,Mink,我在behat中进行了获取状态响应的测试,但出现以下错误: 这是我的设想: Feature: Google @javascript Scenario: Search Given I am on the homepage When I go to "http://stackoverflow.com" Then I wait 3 seconds And the response status code sh

我在behat中进行了获取状态响应的测试,但出现以下错误:

这是我的设想:

Feature: Google

      @javascript

      Scenario: Search
        Given I am on the homepage
        When I go to "http://stackoverflow.com"
        Then I wait 3 seconds
        And the response status code should be 200
代码ph:

 /**
 * @Then the response status code should be :arg1
 */
public function theResponseStatusCodeShouldBe($arg1)
{
    if ((string)$this->_response->getStatusCode() !== $arg1) {
 var_dump('HTTP code does not match '.$httpStatus.' (actual: '.$this->_response->getStatusCode().')');
    }

}

如何解决此错误?

请避免重新定义现有步骤。
您在MinkContext中已经有了此步骤

您应该使用在phpstorm等功能文件中具有自动完成功能的IDE编辑器

不明确匹配
错误是因为已经定义了具有相同代码段的方法。
不能使用相同的代码段定义步骤