Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Deepak2018 Regular Contributor.
Regular Contributor.
351 views

Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using TestNG

When we try to generate customised leanFT HTML report using TestNG , our one Test method runs multiple test cases but customised report generating only first test case report, for the second test case it is overrwiting in the same Report folder of first test case and report folder also not creating for second test case. Could you please help me why this problem happening.

Goods Classification Code module contain 3 test cases but Report folder creating only for first test case for second test case it is overwriting in the same folder of first test case.

 

//Test method

//public class LeanFtTest extends UnitTestClassBase {
public class LeanFtTest {
// Goods Classification Code Module
/* @test(priority=0)
public void verifyConsolidation() throws Exception {

try {
SabreFlow1.TestShip("Goods Classification Code");
} catch (NullPointerException e) {
e.printStackTrace();
Reporter.reportEvent("Catch Block","Failed due to error", Status.Failed);
Assert.assertTrue(false);
} catch (Exception e) {
e.printStackTrace();
Reporter.reportEvent("Catch Block","Failed due to error", Status.Failed);
Assert.assertTrue(false);
}
}*/

0 Likes
7 Replies
Micro Focus Expert
Micro Focus Expert

Re: Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using Te

Hi,

Could you please explain what do you mean by customised leanFT HTML report?

Could you share all the calls you perform using the LeanFT Reporter API, and thier locaiton?

 

Regards,

Anton

0 Likes
Deepak2018 Regular Contributor.
Regular Contributor.

Re: Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using Te

Instead of saving HTML report in the default path, i am saving report in the specified of path calling the ModifiableReportConfiguration in the main flow using  below

ModifiableReportConfiguration mrc = LFT_Methods.reportInit(module, testCase);
Reporter.init(mrc);

public static ModifiableReportConfiguration reportInit(String module, String testCse)
throws IOException, ReportException, InterruptedException {
ModifiableReportConfiguration config=new ModifiableReportConfiguration();
config.setOverrideExisting(false);
String tc = testCse.replaceAll("\\s", "").replaceAll("\\(", "").replaceAll("\\)", "").replaceAll("–", "").replaceAll(",", "");
String file = System.getProperty("user.home")+"\\SABRE Automation\\Reports\\" + module + "\\";
File reportfolder ;
reportfolder = new File(file);
reportfolder.mkdirs();
config.setTargetDirectory(file);
config.setReportFolder(tc);
config.setTitle(testCse);
config.setDescription(testCse);
return config;
}

What is happening here when i am calling mainflow using above TestNG method, module contain multiple test cases, when one test case completed saving the report in the specfied folder, for second test case Reunresult is overwriting the same folder of first test case, it is not creating second folder test case name and report because it is overwriting in the first test case folder.

 

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using Te

Hi,

I'm not sure that I understand what do you wish to achieve.

Do you simply want to save the LeanFT report into a different target folder?

Do you want the report of each test case to be in a separate folder?

How many times are you invoking Reporter.init during your execution?

And final question, are you using the LeanFT TestNG template, or your own custom framework?

 

Regards,

Anton

0 Likes
Deepak2018 Regular Contributor.
Regular Contributor.

Re: Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using Te

Do you want the report of each test case to be in a separate folder?

We need  report of each test case to be in a separate folder

How many times are you invoking Reporter.init during your execution?

We have tried invoking one time for the module as well as Each test case loop result is same.

our own custom framework but for the calling the main method we are using LeanFT TestNG template.

 when we run multiple test cases, when the first test case is run, a directory for that test case is created with the test case report. When the next preceding test case is run, it overwrites the first test case report and then the next test case does the same iteratively.

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using Te

Hi,

 

In LeanFT 14.50 we have added a new report granularity feature:  

https://admhelp.microfocus.com/leanft/en/14.51/HelpCenter/Content/HowTo/TestSettingsFiles.htm#ReportSetting

have you tried it?

Also are you using the Reporter.startTest\endTest functionality? if you are not using the LeanFT frame work you need to call those methods to inform LeanFT reporter of when a test starts and ends.

 

Regards,

Anton

0 Likes
Deepak2018 Regular Contributor.
Regular Contributor.

Re: Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using Te

Yes we are using the  Reporter.startTest\endTest  to each test case loop .sill it is not creating seperate folder for each test case it is overrding in the firsr test case folder itself.

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: Customised LeanFT HTML Report is overriding when run multiple testcases in single Test using Te

Hello,

Are you trying to get a report per test or per test case?

The report granularty feature currently supports separation per class and per test, not per test case.

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.