preserve-order=true not working for testng html report file

93 views
Skip to first unread message

Ahmed

unread,
Jan 30, 2015, 8:45:50 AM1/30/15
to testng...@googlegroups.com
Hi everyone,

I have written couple of methods and executed testSuite. TestSuite runs successfully but when i m seeing 'index.html', its showing success cases result in alphabetical order.

==============
Here is the code:
==============
package testng.order.execution.testCases;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.*;

public class DemoTestNG {
public WebDriver driver = new FirefoxDriver();

@Test
public void gmailLogin() {

driver.get("http://www.google.com");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("Cheese!");
element.submit();
System.out.println("Page title is: " + driver.getTitle());

}

@Test
public void amailLogin() {
driver.get("http://www.google.com");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("Cheese!");
element.submit();
System.out.println("Page title is: " + driver.getTitle());
//driver.quit();
}

}


=============
testng.xml code:
=============
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="HTML Test Execution Order" preserve-order="true" verbose="0" junit="false" parallel="false">

<listeners>
      <listener class-name="org.uncommons.reportng.HTMLReporter"/>
      <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
  </listeners>

<!--FireFox Browser Parameter -->
<test name="Firefox Test">
<parameter name="browser" value="firefox" />
<classes>
<class name="testng.order.execution.testCases.DemoTestNG">
<methods>
<include name="gmailLogin" />
<include name="amailLogin" />
</methods>
</class>
</classes>
</test>
</suite>


Then i checked 'index.html' in surefire-reports folder, its showing result alphabetical. I need html report in test execution order. Any idea if something is missing?

=====================
See index.html snapshot
=====================

As 'gmailLogin' was the first case executed but its showing 'amailLogin' as first case. I want to see html report in executed case order not alphabetically sorted order. Kindly suggest me if i m missing something.

Ahmed

unread,
Jan 31, 2015, 7:23:17 AM1/31/15
to testng...@googlegroups.com
My problem is the order of the RESULTS according to the order of execution, not the order of execution.
Reply all
Reply to author
Forward
0 new messages