Selenium错误节点未定义

时间:2015-02-04 11:46:01

标签: selenium behat

我有测试场景。我从选择框中选择了选项,但是我得到错误"节点未定义" 这是我的方案

Feature: Search
  In order to see a word definition
  As a website user
  I need to be able to search for a word
  @javascript
  Scenario: Searching for a search working
    Given I am on "/test.html"
    When I select "1" from "test"
    Then I should see "1"

这是html页面

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<select name="test" id="test">
    <option value="2">2</option>
    <option value="1">1</option>
</select>

</body>
</html>

当我运行behat test.feaute时 结果在这里

 Given I am on "/test.html"             # FeatureContext::visit()
    When I select "1" from "test"          # FeatureContext::selectOption()
      node is undefined
      Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
      System info: host: 'LM-IST-00Y5FH00', ip: '10.238.236.79', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.1', java.version: '1.6.0_65'
      Driver info: driver.version: unknown

0 个答案:

没有答案