Hello! I work as a software tester and have been trying to incorporate QAF in an automated testing project I have been working on. The main project uses Selenium, but before I start including QAF in it, I have been working on a small pilot project of sorts just to try out QAF and see if I can make it work. I have been struggling to make it work and have some questions I could use help with:
1. When I try to initiate a simple run of a scenario from Gherkin feature that uses a JSON dataFile as Examples (and also when I try to enter the indata examples in the feature file), I get the following error text:
[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.
org.testng.TestNGException:
The factory method class com.qmetry.qaf.automation.step.client.ScenarioFactory.getTestsFromFile() threw an exception
at org.testng.internal.FactoryMethod.invoke(FactoryMethod.java:197)
at org.testng.internal.TestNGClassFinder.processFactory(TestNGClassFinder.java:223)
at org.testng.internal.TestNGClassFinder.processMethod(TestNGClassFinder.java:179)
at org.testng.internal.TestNGClassFinder.processClass(TestNGClassFinder.java:171)
at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:121)
at org.testng.TestRunner.initMethods(TestRunner.java:370)
at org.testng.TestRunner.init(TestRunner.java:271)
at org.testng.TestRunner.init(TestRunner.java:241)
at org.testng.TestRunner.<init>(TestRunner.java:192)
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.<init>(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.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.FactoryMethod.invoke(FactoryMethod.java:167)
... 21 more
3. When feature examples are given in feature files as "Examples: {'dataFile':'path/To/File.json'}", does a DataProvider need to be given in the code?
4. Where is it appropriate to use the @QAFDataProvider tag? I have done some testing using TestNG, where the DataProvider tag was given in the metadata for test functions. In those, you could link the providers by name as well as data provider class, but from what I've been able to tell, the @QAFDataProvider tag doesn't allow those parameters.
5. The Stack Overflow post linked to in 2. also included a comment mentioning that QAF doesn't need a runnertest class to run the test scenarios. Does that mean that it should be possible to launch the tests using only the testng.xml file?
I appreciate any help and advice I can get.