我正在使用下面的maven项目尝试黄瓜示例。
http://artoftesting.com/automationTesting/sampleScript/cucumberJava.zip
编译工作正常,但测试失败,出现以下错误..
var focusedControl = FocusManager.GetFocusedElement(this);
var tBox = focusedControl as TextBox;
if (tBox != null)
tBox.Text = "txt";
以下是我的pom.xml的快照。
Results :
Tests in error:
initializationError(artOfTesting.googleCalcTest): Failed to instantiate public cucumber.runtime.java.JavaBackend(cucumber.runtime.io.ResourceLoader) with [cucumber.runtime.io.MultiLoader@59fa1d9b]
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
我是否需要包括除此之外的任何其他罐子以克服此错误?
答案 0 :(得分:1)
您需要确保cucumber-java
依赖项版本与cucumber-core
依赖项版本匹配。替换:
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.3</version>
<scope>test</scope>
</dependency>
使用:
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.4</version>
<scope>test</scope>
</dependency>