BDD + CUCUMBER + TestComplete版本12
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BDD + CUCUMBER + TestComplete版本12相关的知识,希望对你有一定的参考价值。
我已经在IntelliJ中构建了该项目,并遵循了此https://support.smartbear.com/articles/testcomplete/bdd-cucumber-and-testcomplete/中提到的所有步骤。
所以我已经检查过了
- 我已经在我的电脑上安装了测试完成和测试执行(官方版本而不是跟踪版本);
- 我已经使用管理员角色运行了测试完成和IntelliJ;
- 我在ProjectStructure中建立了路径 - >库到
TestComplete.jar
; - 我在系统变量中添加了
M2_HOME
和M2
路径到maven。
但是当我从TestRuner从IntelliJ执行时,我仍然有以下错误:那么请你帮忙找出问题的来源?非常感谢。
java.lang.Exception: TestComplete/TestExecute not found
at com.smartbear.cucumber.TestComplete.<init>(TestComplete.java:42)
at NewTC.World.TC(steps.java:71)
at NewTC.steps.before(steps.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:37)
at cucumber.runtime.Timeout.timeout(Timeout.java:13)
at cucumber.runtime.Utils.invoke(Utils.java:31)
at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:59)
at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:222)
at cucumber.runtime.Runtime.runHooks(Runtime.java:210)
at cucumber.runtime.Runtime.runBeforeHooks(Runtime.java:200)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
java.lang.IllegalArgumentException: Can't pass in null Dispatch object
at com.jacob.com.Dispatch.throwIfUnattachedDispatch(Dispatch.java:283)
at com.jacob.com.Dispatch.get(Dispatch.java:1257)
at com.smartbear.cucumber.TestComplete.GetIntegration(TestComplete.java:100)
at com.smartbear.cucumber.TestComplete.GetLog(TestComplete.java:152)
at NewTC.steps.before(steps.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:37)
at cucumber.runtime.Timeout.timeout(Timeout.java:13)
at cucumber.runtime.Utils.invoke(Utils.java:31)
at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:59)
at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:222)
at cucumber.runtime.Runtime.runHooks(Runtime.java:210)
at cucumber.runtime.Runtime.runBeforeHooks(Runtime.java:200)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
在联系TestComplete的支持后,我成功运行了该示例。希望解决方案也能帮到你。
以下是解决方案:“使用已禁用的防病毒软件和Windows防火墙重新安装TestComplete是有意义的。以防万一,您可以尝试在TestComplete中禁用Windows应用商店应用程序支持(工具 - >选项 - >引擎 - >常规 - >启用支持测试Windows应用商店应用程序。。也许,这将有所帮助。“
SmartBear为BDD测试提供了更好的方法 - TestLeft。有关如何在本文档中执行此操作的更多信息,请访问:https://support.smartbear.com/testleft-java/docs/bdd/tutorial/cucumber/index.html
以上是关于BDD + CUCUMBER + TestComplete版本12的主要内容,如果未能解决你的问题,请参考以下文章
[易学易懂系列|rustlang语言|零基础|快速入门|(29)|实战6:BDD工具cucumber_rust]
BDD + CUCUMBER + TestComplete版本12
Cypress BDD:Cypress Cucumber 处理器:无法运行步骤定义 .js 文件
使用 cypress-cucumber-preprocessor 将现有的 cypress 测试转换为黄瓜风格的 bdd。第二个场景没有被选中