當我嘗試運行場景大綱時,出現此錯誤 - CucumberException:無法創建場景運行器。CucumberException:無法創建場景運行器
幾天前,相同的場景大綱已成功運行,但現在出現此錯誤。
我在網上查找這個錯誤,發現許多帖子提示它使用junit時發生4.12。但我使用的是junit 4.11,而且我仍然保持一致。
這裏是我的POM依賴關係:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.8</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.8</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>1.1.8</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.42.2</version>
</dependency>
</dependencies>
這是黃瓜代碼:
Scenario Outline: Google search on different browsers
Given user opens google using <Browser>
When user searches for "Hello World"
Then user sees the results
Examples:
| Browser |
| FireFox |
| Internet Explorer |
有什麼建議?
問題是cucumber-junit 1.1.8版本。 將其更改爲應該兼容的版本1.2.2 – MikeJRamsey56