TestNG detected TestNG version 7.4.0 error - java

I have this TestNG part :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<listeners>
<listener class-name="ShufersalMiron.Sprod.Listeners"/>
</listeners>
<test name="Test1">
<classes>
<class name="ShufersalMiron.Sprod.PA_Coupons"/>
</classes>
</test> <!-- Test -->
<test name="Test2">
<classes>
<class name="ShufersalMiron.Sprod.PA_SupermeCoins"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
When I am trying to run it as a suite I get this error :
Can someone please tell me what could be wrong and how to solve it please ?
Thanks.

The error might be due to conflicting dependencies.
extentreports-java version 5.0.9 (latest for now)
https://github.com/extent-framework/extentreports-java/blob/master/pom.xml
uses io.reactivex.rxjava3:rxjava-3.0.4 and org.testng:testng-7.3.0.
I can suggest 2 options:
Try to add io.reactivex.rxjava3 dependency, since
NoClassDefFound error references this.
Maven:
<dependency>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxjava</artifactId>
<version>3.0.4</version>
</dependency>
Gradle:
implementation 'io.reactivex.rxjava3:rxjava:3.0.4'
Try to use testNG 7.3.0 instead of 7.4.0.

Related

The markup declarations contained or pointed to by the document type declaration must be well- formed

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Test">
<classes>
<class name="upskill.runners.RunnerClass"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
With this line tstng.xml file shows error but if i delete this line then it doesn’t show error.
how do i fix this problem?

QAF 3.0.1b | Not picking test after upgrading QAF from 3.0.0 to 3.0.1b

When I upgraded my existing package in POM.xml (Maven) from QAF 3.0.0 to 3.0.1b my automation test stopped picking up the tests mentioned in testng.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
All my tests are standard BDD (Gerkin) written and managed according to https://github.com/qmetry/qaf-blank-project-maven
Note: When I checked QAF latest repo all tests are written inside /test
My project structure
/scenarios
/config/
/src/...
..etc
Below is my TestNg config
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="test suite 1" verbose="0" parallel="none">
<listeners>
<listener class-name="com.proj.listener.proj_listener" />
</listeners>
<test name="Config-1" enabled="true">
<parameter name="env.resources" value="resources;executions/exec_1"/>
<groups>
<run>
<include name="#sit1" />
</run>
</groups>
<classes>
<class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory"/>
</classes>
</test>
</suite>
Try using meta-data filter. For example:
<test name="Config-1" enabled="true">
<parameter name="env.resources" value="resources;executions/exec_1"/>
<parameter name="include" value="{'groups':['#sit1']}"></parameter>
<classes>
<class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory"/>
</classes>
</test>

TestNG intelli-sense not working in Eclipse neon

Here is the software, library i am using:
1) Eclipse Neon
2) TestNG - 6.10
3) Maven Project
TestNG intelli-sense not working for me in Testng.xml file. Earlier it was working.
Earlier it was showing suggestions for following tags i.e. methods, method, listener etc.
Can someone faced the same issue.
Here is my testng.xml.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" >
<listeners>
<listener class-name="x listener" />
</listeners>
<test name="Smoke">
<parameter name="platform" value="test" />
<classes>
<class name="smoke" />
</classes>
</test>
</suite>

Show all failed tests of multiple test suite in one testNG report

Actually I'm testing multiple website for my company. All the website have the same structure and i'm testing various things on each.
For my test i have a Selenium Java Maven project using TestNG. For each web site, i've created a sub folder and generate a specific testing.xml file to specify each test i'm doing for the website.
Here the structure : http://imgur.com/g0VHfMw
My testing.xml files are like this :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Test suite website 1" parallel="tests" thread-count="2">
<test name="Test1">
<classes>
<class name="package.for.mytest1"></class>
</classes>
</test>
<test name="Test2">
<classes>
<class name="package.for.mytest2"></class>
</classes>
</test>
<test name="Test3">
<classes>
<class name="package.for.mytest3"></class>
</classes>
</test>
</suite>
How can I merge this 4 test suite in one testNG report ? And if it's possible, is there a way to only show the unstable or failed test on it ?
Any ideas ? Thanks for your help
Try Allure it could easily generate combined report for several suites and show only failed/broken tests by default.
Either you can Use Suite-XML tag in TestNG.xml file to report all your test in single report or implement a reporter of your own to collect all the results and then at the end flush everything into report of your own format with whatever information you need.
You can create a separate testng.xml file in which you can give the path of other testsuites files.
eg:-
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name= "Allsuites" verbose="1" preserve-order="true" >
<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter"/>
<listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
</listeners>
<suite-files preserve-order="true">
<suite-file path="testng1.xml" />
<suite-file path="testng2.xml" />
<suite-file path="testng3.xml" />
</suite-files>
</suite>

Attribute "parallel" with value "none" must have a value from the list "false methods tests classes instances "

I have created maven project using selenium webdriver in these I have integrate the testng, but when I validate my maven project it displayed "Attribute "parallel" with value "none" must have a value from the list "false methods tests classes instances" in testng-failed.xml and in testng.xml.
Can anyone please help me to resolved this problem.
testng-failed.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Failed suite [Gmail]" parallel="none">
<test name="GmailLoginTest(failed)" parallel="none">
<classes>
<class name="gmailTestcc.LoginTest">
<methods>
<include name="setUp"/>
<include name="mainAndGmailDashboardTest"/>
</methods>
</class> <!-- gmailTestcc.LoginTest -->
</classes>
</test> <!-- GmailLoginTest(failed) -->
</suite> <!-- Failed suite [Gmail] -->
testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Gmail" parallel="none">
<test name="GmailLoginTest">
<classes>
<class name="gmailTestcc.LoginTest"/>
</classes>
</test> <!-- GmailLoginTest -->
</suite> <!-- Gmail -->
Based on your error message, I think this problem was caused by this attribute in your testng.xml "parallel="none"". Could you change it to false to have a try?
The issue is not related to Maven, it relates to TestNG itself, you can try solving it either by replacing
parallel="none" by parallel="false"
or changing your TestNG version from (6.9.10) to (6.9.9) because this issue is related to TestNg version 6.9.10.
Please note that if you used the second solution (which is better), you have to change
parallel="none" by parallel="false"
Error: Attribute "parallel" with value "none" must have a value from the list "false methods tests classes instances throws by the testNG if parallel execution is not handling properly in test suite :
if want to handle test execution parallel then use below xml suite:
<suite name="regression" parallel="test" threadcount="10">
Otherwise don't use parallel attribute in test suite

Categories