Qaf: Latest TestNg Support issue

Created on 6 Apr 2019  ·  12Comments  ·  Source: qmetry/qaf

QAF Version

2.1.14

Issue

Hi while running cucumber with QAF from xml file using com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory with latest Testng(6.14), it is throwing error. But with TestNg version 6.10.0 it is working fine.

Error log

[RemoteTestNG] detected TestNG version 6.14.3
log4j:WARN No appenders could be found for logger (com.qmetry.qaf.automation.testng.pro.QAFAnnotationTransformer2).
log4j:WARN Please initialize the log4j system properly.
java.lang.NoClassDefFoundError: org/testng/internal/Constants
at org.testng.TestRunner.(TestRunner.java:131)
at org.testng.remote.support.RemoteTestNG6_12$1.newTestRunner(RemoteTestNG6_12.java:33)
at org.testng.remote.support.RemoteTestNG6_12$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_12.java:66)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:713)
at org.testng.SuiteRunner.init(SuiteRunner.java:260)
at org.testng.SuiteRunner.(SuiteRunner.java:198)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1295)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1273)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.ClassNotFoundException: org.testng.internal.Constants
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more

Environment

Eclipse
Maven

duplicate

All 12 comments

duplicate #174

Is there any specific reason you want to use TestNG latest version? There are many changes in TestNG newer version that may result in inconsistency for existing users and that's why most of the enterprise users want to stick with one proven version.

I was just trying to use latest version of all jars. Is there any option of specifying which TestNg version I want to use with QAF framework or I need to stick to default TestNg version shipped with QAF framework?

For TestNG, don't specify TestNG version and let qaf decide which version of TestNG to use. For Selenium and appium you should be able to use what ever version required for execution environment.

If you found that other dependencies overrides TestNG version, you can exclude TestNG like this example from other dependencies. Example is using IVY and same you can do with maven or gradle.

Ok got it.... Thanks for clarifying. Is QAF going to upgrade TestNg version with Time or option of specifying TestNg version ?

If you will not specify TestNG version it will automatically use what ever version provided in qaf dependency. So in future if qaf dependencies get updated with update of qaf version your project should be able to resolve required version of TestNG.

With #174 we are planning to allow user to choose one of the supported version of TestNG by introducing separate qaf-testNG extension dependency. In that case also instead of specifying TestNG version user may need to specify qaf-testng version which in turn will resolve appropriate testng version.

To be brief follow steps as above comment.

Thanks

I am trying to work on gherkin.GherkinScenarioFactory to feed data for Examples in feature files from excel sheet, could you please provide me a working example.

This may be out of context here, but I couldn't get many examples on the same.

@vamshinookala555 please refer documentation.

I have gone through it, but somehow I am unable to integrate QAF to my exisiting project, so asking your help with example project.

Closing duplicate issue.

@vamshinookala555 your comment in not related to original reported issue. Please post your queries and/or questions to users group.

i am using QAF 3.0 framework along with TestNG 7.4.0 version and seeing the above mentioned error. can you please be specific which version of TestNG is supported for QAF 3.0.0. Also can you share which dependency should come first in POM.XML file

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BChitrakannan picture BChitrakannan  ·  9Comments

raviguptasmarsh picture raviguptasmarsh  ·  8Comments

cjayswal picture cjayswal  ·  17Comments

APrem picture APrem  ·  7Comments

Nandesh7 picture Nandesh7  ·  8Comments