2

I am running a TestNG.xml I have created a maven project for my automation selenium script and added all the required dependencies to pom.xml. If I run the suite defined in the Testng.xml file using TestNG.run() command TestNG test result console is blank. And please do share if there is any other way to run the testNG.xml from main() method so that I can get each test case status in testNG console

Please refer the code that I have used

TestNG testng = new TestNG();
List<String> suites = Lists.newArrayList();
suites.add(currdir+"/tempTestNG.xml");//path of xml..
testng.setTestSuites(suites);
testng.run();

Please refer the testNG.xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
    <parameter name="ExecutionType" value="Regression"/>
    <listeners>
        <listener class-name="config.TestListener"/>
    </listeners>
    <test name="Test">
        <classes>
            <class name="testsuits.VerificationOfWiki">
                <methods>
                    <include name="VerifyMainpagetextonWiki"/>
                    <include name="VerifyRandomArticletextonWiki"/>
                </methods>
            </class>
        </classes>
    </test>
</suite>
  • How is the question related to _Selenium_? – undetected Selenium Nov 28 '19 at 11:41
  • Can you provide more information? What does your testng.xml look like? What is the results report? Failed? Passed? Or just doesn't run? How are your methods annotated? – Rodrigo Vaamonde Nov 28 '19 at 11:57
  • @RodrigoVaamonde I have updated the TestNG.xml file and when with the code, if I execute the testNG.xml file, cases are executed and for the executed cases I can see the result in TestNG report (after the execution is completed) but the same status is not updating in TestNG console like what used to display when we directly run a suite file I can the result in testNG test cases result console. Thanks for the response – Mayank Arora Nov 28 '19 at 12:30

0 Answers0