HTML Colours are not getting reflected in the report in TestNG 6.8 release
When we give HTMLcode in the Reporter.Log function, generally that particular colour will be reflected for whatever we have given in the HTML report we get, till TestNG 6.7 release but the color is not getting applied from TestNG 6.8 releases. We get some weird error messages if we give the HTML Color code. This is an important aspect which helps to filter the log report(emailable report) with different colours
Do you see the problem with 6.8.1 as well? If you do, can you give some details?
Yes the issue persists in 6.8.1 also ..
Actually if we give a code "Reporter.log("
"+message+"");", we lll get the message in red color but it does not happen in 6.8 releases. it just prints the contents present in the reporter.log function instead of printing it in red....."Font Color tag given inside the reporter.log method "
Can anybody plz provide a solution for this?.....it does play an important role I would say :)
cbeust : Can you plz look into the issue specified above and come up with a solution ?
@cbeust I am also facing the same issue..The html tags are getting escaped in the report and is coming as a raw text output. For Example:Reporter.log("PASS"); Output: PASS, but i wanted in Green color..
Operating System Used is: Windows 7
@cbeust I am trying to insert a screenshot link to emailable report.
Below is my code
Reporter.setEscapeHtml(false);
Reporter.log("<a href = "screenshot_filepath"><font color='red'>Link</font></a>" );
It is giving the red link in index.html, but in emailable report, it is printing the plain text
Can you pls provide me a solution for this?
TestNG: 6.9.9
Hi, Anyone has found a solution for tags getting escaped. I have tried all the possible things mentioned in the internet. But no luck.. Output is getting displayed as below: [a href="C:/2016.12.01.23.03.59.jpg"] [img src="C:/2016.12.01.23.03.59.jpg"/] [/a]
1.ReportNG reports are generating properly 2. I have set the escape property as System.setProperty("org.uncommons.reportng.escape-output", "false") 3. I disabled the default listeners from project properties. 4. I added reportng listeners to testng.xml and pom.xml.
Not sure why the screenshots are not getting displayed. Please anyone suggest.
Hi @cbeust : Escaping is not getting turned off in emailable report html . Please fix asap Thanks
@mmtmohit - I am not able to reproduce this problem using TestNG 6.10. It would be good if you could please help furnish a reproducible test that can be used to recreate the problem if you feel that the issue still exists when using TestNG 6.10
Here's what my test class looks like
import org.testng.Reporter;
import org.testng.annotations.Test;
import java.io.File;
public class SimulateIssue {
@Test
public void testMethod() {
Reporter.setEscapeHtml(false);
Reporter.log("<a href='http://www.google.com'><font color='red'>Open Google</font></a>", true);
String currentDir = "file://" + new File(System.getProperty("user.dir")).getAbsolutePath() + File.separator + "pom"
+ ".xml";
Reporter.log("<a href='" + currentDir + "'><font color='green'>View Pom file</font></a>", true);
}
}
Here are the screenshots from the generated reports
Emailable-Report

Default TestNG report (index.html)

@mmtmohit With testNG 6.10, i am not able to reproduce the issue. Date of release for testNG 6.10 is (Dec 06, 2016).
Use the below link to know the latest testNG releases. https://mvnrepository.com/artifact/org.testng/testng/
I suggest to use the maven dependencies in your project so that you will not face this issues in future.
Looks fixed in 6.10 Feel free to reopen if it is not the case.
Hi all,
I would like to generate the output with different colors at testng reports.
I am using the following syntax, but not working.
"Reporter.log("<font color='red'> Hello world </font>");
Desired output is Hello world in red color, but actual output is <font
color='red'> Hello world </font>.
I am using testng 6.10. Please let me know if anything else we need do
@sravee123 - Please open a new issue, include all the details and you can cross reference this issue in the new one.