2015-06-09 77 views
1

我開始工作測試自動化,目前我有一個小問題。黃瓜場景大綱與示例:未能創建場景跑步者

我做了小黃瓜情景:

Feature: Post Draft 

    Scenario: Successful Login with Valid Credentials 
    Given User go to Admin Page 
    Then User enters UserName and Password 

    Scenario Outline: Successful creation post draft 
    Given User navigate to pages list 
    Then User open page with ID <postsIds> for editing 
    Then User navigate to Advertising tab 
    Then User check custom ads code radio button 
    And Insert custom advertising code 
    Then User save post 
    And See that custom ads code is appears 

    Examples: 
     | postsIds | 
     | 61591 | 
     | 62231 | 
     | 61827 | 
     | 63300 | 
     | 62023 | 
     | 62231 | 

,當我試圖執行這種情況下,我得到了錯誤:

cucumber.runtime.CucumberException: Failed to create scenario runner 
    ... 21 more 

讓別人同樣的問題?我不知道什麼問題,因爲如果我刪除大綱關鍵字和示例列表,測試正在運行...

我實現了所有步驟,它的工作沒有大綱,但我有很多值, t要爲每個值實施步驟,那爲什麼我需要使用場景概要

請幫我解決此問題。

回答

2

我發現了這個問題。我更新了cucumber-junit包到最新版本,它沒有向後兼容性。

這裏是Maven的依賴性作品:

<dependencies> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-picocontainer</artifactId> 
     <version>1.1.8</version> 
    </dependency> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-junit</artifactId> 
     <version>1.1.8</version> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.11</version> 
    </dependency> 
    <dependency> 
     <groupId>org.seleniumhq.selenium</groupId> 
     <artifactId>selenium-server</artifactId> 
     <version>2.42.2</version> 
    </dependency> 
</dependencies> 

GHERKIN: SCENARIO OUTLINES

我也有Cucumber testing guide

+1

酷的文章!非常感謝你的幫助! –