0
votes
<target name="run" depends="compile, gendoc" description="Execute Selenium Tests">
        <testng classpath="${test.classpath}:${test.dest}" suitename="Selenium_Tests" outputdir="${test.report}" workingdir="${test.report}"
                useDefaultListeners="true"
                listeners="org.uncommons.reportng.HTMLReporter,
                           org.uncommons.reportng.JUnitXMLReporter">
            <jvmarg value="-javaagent:${ivy.lib.dir}/aspectjweaver-${aspectj.version}.jar"/>
            <xmlfileset dir="." includes="testng.xml"/>
        </testng>
        <copy todir="${test.report-dir}">
            <fileset dir="${test.report}"/>
        </copy></target>

The above code i have for generating the allure report and running my tests, It runs and generates a folder within reports - Allure-Results which contains JSON files. see below screenshot

And from Allure command line i am trying to open the report but it always says

allure generate report report does not exists Report successfully generated to allure-report

2
The report from Allure command line always shows an empty report without any data, Please suggest me how to generate the report - ANGIRA SARKAR
Requeting help from Allure gods - ANGIRA SARKAR

2 Answers

1
votes

Step 1. Add dependencies Allure Builder Reporter into pom.xml https://mvnrepository.com/artifact/ru.yandex.qatools.allure/allure-report-builder/2.1

Step 2: Added below code.

// It will generate the Allure Report folder.
new AllureReportBuilder("1.5.4", new File("target/allure-report")).unpackFace(); 
new AllureReportBuilder("1.5.4", new File("target/allure-report")).processResults(new File("target/allure-results"));
0
votes

Update your allure command-line to version 2

Explanation:

Allure work in 2 step.

  • First step, during the execution of your tests, generate data files.
  • Second step, after the execution of your tests, generate your web report.
  • In allure version 1. Data files are in XML.
  • In allure version 2. Data files are in JSON.

So when you trigger in your command line with allure (version 1). He looks for XML files. Since your files are in JSON, he don't find any data and generate an empty report.


To check your version of allure command-line:

allure --version

Ensure you have the version 2.x.x