Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

Tests showing as twice #731

@fropcorn-ravi

Description

@fropcorn-ravi

untitled

Hello i have an issue for getting the reports where i am using giving parameters in testng.xml to run the same test class twice for different devices. everything is going fine but in the report all the test cases are showing twice for each device.
my testng.xml file is as follows

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="testExecution" parallel="methods" thread-count="2">
  <test name="SamsungS4">
      <parameter name="device" value="Samsung5.1.1"></parameter>
      <parameter name="deviceName" value="a01b27a8"></parameter>
      <parameter name="version" value="5.1.1"></parameter>
    <classes>
      <class name="testsuite.testExecution"/>
    </classes>
  </test> <!-- Test -->
  <test name="Nexus">
      <parameter name="device" value="Nexus6.0.1"></parameter>
      <parameter name="deviceName" value="03829155439cb1e8"></parameter>
      <parameter name="version" value="6.0.1"></parameter>
    <classes>
      <class name="testsuite.testExecution"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- TestConfig -->

Activity

volkovs

volkovs commented on Jan 11, 2016

@volkovs
Contributor

Hello. IMO it is expected behavior. Report shows as many test cases as many executions there were. It doesn't matter whether the test was parametrized or not. So, if test passed on one device and failed on another one, there will be two test cases with according statuses. For test name you can't use placeholders (as for test steps https://github.com/allure-framework/allure-core/wiki/Steps#placeholders ). But test name should be extended with parameters values automatically.

fropcorn-ravi

fropcorn-ravi commented on Jan 11, 2016

@fropcorn-ravi
Author

Thank you for your reply , I will tell the whole scenario . I am using Appium with help of selenium grid and I am giving device parameters in testng.xml the screenshot I attached is only one test case running in both the devices. But it's showing same test cases many number of times.

volkovs

volkovs commented on Jan 11, 2016

@volkovs
Contributor

@fropcorn-ravi could you please provide testng.xml once more?

Usually duplicated test cases mean duplicated executions (e.g. several Allure adapters in class path, not cleaned project from previous execution, etc.). You can have a look how many tests Allure knows about right after execution (but before report generation). Please look through target/allure-results/*-testsuite.xml files.

fropcorn-ravi

fropcorn-ravi commented on Jan 12, 2016

@fropcorn-ravi
Author

untitled

fropcorn-ravi

fropcorn-ravi commented on Jan 13, 2016

@fropcorn-ravi
Author

i have checked the xml generated by allure report. test cases were showing twice for each device, i have attached the pom xml in the attachement , could you please check and tell where i have done a mistake.
pom.txt
and please find the test allure report generated xml to txt files for both devices
device (1).txt
device (3).txt

modnarlp

modnarlp commented on Jan 19, 2016

@modnarlp

Hello.

I have the same situation as @fropcorn-ravi. In my pom.xml i defined suiteXmlFile in which i defined java class with method marked with @factory annotation. Every time i invoke
mvn clean test
from command line it show me that 3 tests were performed but in report(mvn site) i see twice as much.

FactoryClass.txt
runner.txt
pom.txt

yulia-nechaeva

yulia-nechaeva commented on Jan 21, 2016

@yulia-nechaeva

Hey guys, look at these lines in your pom.xml:

<!--only for 1.3.* TestNG adapters. Since 1.4.0.RC4, the listener adds via ServiceLoader-->
<properties>
    <property>
            <name>listener</name>
            <value>ru.yandex.qatools.allure.testng.AllureTestListener</value>
    </property>
</properties>

Since you are using TestNG version 1.4.* you don't need these properties in the pom anymore. Looks like listener adds twice in that case and that's why tests are showing twice in report.

So, report shows correctly after deleting that piece of code from pom.xml.

modnarlp

modnarlp commented on Jan 22, 2016

@modnarlp

Hello, thanks a lot for your answer. You are absolutely right with that additional AllureTestListener in pom.xml cause the problem.

fropcorn-ravi

fropcorn-ravi commented on Jan 22, 2016

@fropcorn-ravi
Author

Thanks a lot , you were right....

Ravi Kiran
Software Development Engineer in Test
Fropcorn

On 22-Jan-2016, at 12:35 AM, Yulia notifications@github.com wrote:

Hey guys, look at these lines in your pom.xml:

listener ru.yandex.qatools.allure.testng.AllureTestListener Since you are using TestNG version 1.4.\* you don't need these properties in the pom anymore. Looks like listener adds twice in that case and that's why tests are showing twice in report.

So, report shows correctly after deleting that piece of code from pom.xml.


Reply to this email directly or view it on GitHub.

fdPoornima

fdPoornima commented on Oct 18, 2017

@fdPoornima

Hi @fropcorn-ravi : How were you able to insert the details of the devices in the report i.e: Nexus, version etc. Also, for me the second device execution is shown as a retry, is this working fine for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @volkovs@baev@yulia-nechaeva@fropcorn-ravi@modnarlp

        Issue actions

          Tests showing as twice · Issue #731 · allure-framework/allure1