Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Unable to process xml file generated by pytest adapter #5

Closed
pvshewale opened this issue Aug 12, 2014 · 5 comments
Closed

Unable to process xml file generated by pytest adapter #5

pvshewale opened this issue Aug 12, 2014 · 5 comments

Comments

@pvshewale
Copy link

I have generated result xml file using pytest adapter as below:
py.test --alluredir=resultdata test_eval.py

It generated xml file as below

<ns0:test-suite xmlns:ns0="urn:model.allure.qatools.yandex.ru" start="1407823380044" stop="1407823380057">
test_eval


test_eval[3+5-8]





test_eval[2+4-6]





test_eval[6*9-54]






/ns0:test-suite

But when I use allure-cli 2.0 to generate html result on this I get below error

Error on line 215
XTDE0410: An attribute node (severity) cannot be created after the children of the
containing element
at xsl:call-template name="copy-all-without-namespace" (#211)
at xsl:apply-templates (#42)
processing /alr:allure-test-run/test-suites[1]/test-suite[1]/test-cases[1]/test-case[1]/@Severity
at xsl:apply-templates (#216)
processing /alr:allure-test-run/test-suites[1]/test-suite[1]/test-cases[1]/test-case[1]
at xsl:call-template name="copy-all-without-namespace" (#211)
at xsl:apply-templates (#27)
processing /alr:allure-test-run/test-suites[1]/test-suite[1]/test-cases[1]
at xsl:apply-templates (#216)
processing /alr:allure-test-run/test-suites[1]/test-suite[1]
at xsl:call-template name="copy-all-without-namespace" (#211)
at xsl:apply-templates (#14)
processing /alr:allure-test-run/test-suites[1]
in built-in template rule
Exception in thread "main" java.lang.RuntimeException: ru.yandex.qatools.allure.report.AllureReportBuilderException: java.lang.reflect.InvocationTargetException
at ru.yandex.qatools.allure.AllureCli.generate(AllureCli.java:119)
at ru.yandex.qatools.allure.AllureCli.run(AllureCli.java:82)
at ru.yandex.qatools.allure.AllureCli.main(AllureCli.java:73)
Caused by: ru.yandex.qatools.allure.report.AllureReportBuilderException: java.lang.reflect.InvocationTargetException
at ru.yandex.qatools.allure.report.AllureReportBuilder.processResults(AllureReportBuilder.java:113)
at ru.yandex.qatools.allure.AllureCli.generate(AllureCli.java:104)
... 2 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at ru.yandex.qatools.allure.report.AllureReportBuilder.processResults(AllureReportBuilder.java:111)
... 3 more
Caused by: ru.yandex.qatools.allure.data.ReportGenerationException: net.sf.saxon.event.NoOpenStartTagException: An attribute node (severity) cannot be created after the children of the containing element
at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:55)
at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:44)
at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:35)
at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformations(XslTransformationUtils.java:29)
at ru.yandex.qatools.allure.data.TestRunGenerator.generate(TestRunGenerator.java:64)
at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:45)
... 8 more
Caused by: net.sf.saxon.event.NoOpenStartTagException: An attribute node (severity) cannot be created after the children of the containing element
at net.sf.saxon.event.NoOpenStartTagException.makeNoOpenStartTagException(NoOpenStartTagException.java:49)
at net.sf.saxon.event.ComplexContentOutputter.attribute(ComplexContentOutputter.java:296)
at net.sf.saxon.instruct.CopyOf.copyAttribute(CopyOf.java:572)
at net.sf.saxon.instruct.Copy.processLeavingTail(Copy.java:221)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:440)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
at net.sf.saxon.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:174)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:170)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Copy.processLeavingTail(Copy.java:217)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:440)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
at net.sf.saxon.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:174)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:170)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Copy.processLeavingTail(Copy.java:217)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:440)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
at net.sf.saxon.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:174)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
at net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:378)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:333)
at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
at net.sf.saxon.Controller.transform(Controller.java:1621)
at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:52)
... 13 more

If I remove severity attribute from node, then everything works perfect.

@pvshewale
Copy link
Author

looks like github has stripped xml formatted content in above description

<ns0:test-suite xmlns:ns0="urn:model.allure.qatools.yandex.ru" start="1407823380044" stop="1407823380057">
  <name>test_eval</name>
  <test-cases>
    <test-case severity="normal" start="1407823380044" status="passed" stop="1407823380048">
      <name>test_eval[3+5-8]</name>
      <attachments/>
      <labels/>
      <steps/>
    </test-case>
    <test-case severity="normal" start="1407823380049" status="passed" stop="1407823380052">
      <name>test_eval[2+4-6]</name>
      <attachments/>
      <labels/>
      <steps/>
    </test-case>
    <test-case severity="normal" start="1407823380053" status="passed" stop="1407823380056">
      <name>test_eval[6*9-54]</name>
      <attachments/>
      <labels/>
      <steps/>
    </test-case>
  </test-cases>
  <labels/>
</ns0:test-suite>

@vania-pooh
Copy link
Contributor

screen shot 2014-08-12 at 12 22 52 pm
@pvshewale : thank you for the feedback. Right now Py.test adapter only supports Allure 1.3.x (we're working on 1.4 support). The pre-release version of CLI 2.0 available here is by default trying to generate Allure 1.4.x series report (this will be changed to 1.3.x in final 2.0 release). So having CLI 2.0 RC1 you can generate report using the following command:

$ allure -v 1.3.9 /path/to/xml

Did it resolve your problem?

UPD: tested myself with your file and can confirm that it works.

@vania-pooh
Copy link
Contributor

@pvshewale : any update?

@pvshewale
Copy link
Author

Sorry I was bit away for few days and could not verify it. But just checked and it works at my end as well :). Thanks.

@vania-pooh
Copy link
Contributor

@pvshewale : glad to hear. Closing the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants