没有找到语言引擎:beanshell 与组一起运行 TestNG 时 [英] No engine found for language: beanshell while running TestNG with groups
问题描述
我点击了这个链接从Maven运行特定的TestNG组,我是具有类似的 TestNG 项目设置.当我使用 -Dgroups
选项运行 maven 命令时,出现以下错误.我的设置有什么问题.我正在使用 testng version 7.0.0
.请对此提供任何帮助.
I followed this link Running Specific TestNG Groups from Maven and i am having the similar setup of TestNG project. When i run the maven command with -Dgroups
option, i get the below error. What is wrong with my setup. I am using testng version 7.0.0
. Any help on this please.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project SeleniumTestNGProject: There are test failures.
[ERROR]
[ERROR] Please refer to /opt/TestProjects/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR]
[ERROR] No engine found for language: beanshell. Please check your dependencies and have a look at https://github.com/cbeust/testng/wiki/Supported-script-engines
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR]
[ERROR] No engine found for language: beanshell. Please check your dependencies and have a look at https://github.com/cbeust/testng/wiki/Supported-script-engines
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
我的 testng xml 文件是这样的.
My testng xml file looks like this.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Suite">
<listeners>
<listener class-name="Utilities.CustomTestListener"/>
</listeners>
<test name="RegressionTests">
<method-selectors>
<method-selector>
<script language="beanshell">
<![CDATA[whatGroup = System.getProperty("groups");
groups.containsKey(whatGroup);
]]>
</script>
</method-selector>
</method-selectors>
<classes>
<class name="Tests.test_githubLoginTests"/>
<class name="Tests.test_githubPricingTests"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
更新:
在pom文件中添加org.apache-extras.beanshell
依赖项后,再次运行又报错.请帮忙解决这个问题.
After adding the org.apache-extras.beanshell
dependency in the pom file, ran again and got another error. please help on this.
[ERROR] Please refer to /opt/TestProjects/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
推荐答案
您需要将此添加到您的 dependencies
部分:
You need to add this to your dependencies
section:
<dependency>
<groupId>org.apache-extras.beanshell</groupId>
<artifactId>bsh</artifactId>
<version>2.0b6</version>
</dependency>
这里还有 一些替代方法来添加 beanshell 处理器.
Here are also some alternative ways to add beanshell processor.
这篇关于没有找到语言引擎:beanshell 与组一起运行 TestNG 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!