Insert HTML in Resport.log()

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Insert HTML in Resport.log()

Rafael Carvalho
Hi,

I can now print my result in report.log (), but I would like to build a table inside it with html, how can we insert html in the report?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Insert HTML in Resport.log()

SUBRAMANYESWARA RAO BHAVIRISETTY
Exactly, And if you are using reportng, set the following system property variable.

                        <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>

String reason = "http://jira.com/show_bug.cgi?id="
                    + bugid;


 Reporter.log("<a href=\""+ reason + "\">Bug " + bugid + "</a>" );

You can get the hyperlink in the testng html reports with the above code.


On Wed, Jul 2, 2014 at 6:18 AM, Rafael Carvalho <[hidden email]> wrote:
Hi,

I can now print my result in report.log (), but I would like to build a table inside it with html, how can we insert html in the report?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.



--
Subramanyam

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Insert HTML in Resport.log()

Rafael Carvalho
In reply to this post by Rafael Carvalho
Hi Subramanyam

Thank for the reply :)

But my goal is make a build a table for organize my variables. An example in attachment :)

Cheers,
Rafa

Em quarta-feira, 2 de julho de 2014 10h18min27s UTC-3, Rafael Carvalho escreveu:
Hi,

I can now print my result in report.log (), but I would like to build a table inside it with html, how can we insert html in the report?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

table_model.png (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Insert HTML in Resport.log()

SUBRAMANYESWARA RAO BHAVIRISETTY
Ok try this.


            Reporter.log("<TABLE BORDER=\"5\" WIDTH=\"50%\" CELLPADDING=\"4\" CELLSPACING=\"3\"><TR><TH COLSPAN=\"3\"><BR><H3>TABLE TITLE</H3></TH></TR> <TR><TH>Column A</TH><TH>Column B</TH><TH>Column C</TH></TR><TR ALIGN=\"CENTER\"><TD>Data 1</TD><TD>Data 2</TD><TD>Data 3</TD></TR></TABLE>");

So I have actually hard-coded the string. You can generate the string in whatever format you want.
It will generate table like



TABLE TITLE

Column AColumn BColumn C
Data 1Data 2 Data 3

You should be able to see this when you use reportng and it generates html reports.


On Wed, Jul 2, 2014 at 11:49 AM, Rafael Carvalho <[hidden email]> wrote:
Hi Subramanyam

Thank for the reply :)

But my goal is make a build a table for organize my variables. An example in attachment :)

Cheers,
Rafa

Em quarta-feira, 2 de julho de 2014 10h18min27s UTC-3, Rafael Carvalho escreveu:
Hi,

I can now print my result in report.log (), but I would like to build a table inside it with html, how can we insert html in the report?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.



--
Subramanyam

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Insert HTML in Resport.log()

Rafael Carvalho
In reply to this post by Rafael Carvalho
Hi Subramanyam

Thanks for the reply :)

The table was not generated. See in attachment.

Em quarta-feira, 2 de julho de 2014 10h18min27s UTC-3, Rafael Carvalho escreveu:
Hi,

I can now print my result in report.log (), but I would like to build a table inside it with html, how can we insert html in the report?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

error.PNG (27K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Insert HTML in Resport.log()

SUBRAMANYESWARA RAO BHAVIRISETTY
Can you share your code please?

Looks like it will not render html table if you do Reporter.setEscapeHtml(true);
So if you have done Reporter.setEscapeHtml(true) just try to set it to false. Or by default the value is false.


Bug 6764196

TABLE TITLE

Column AColumn BColumn C
Data 1Data 2Data 3



On Thu, Jul 3, 2014 at 5:30 AM, Rafael Carvalho <[hidden email]> wrote:
Hi Subramanyam

Thanks for the reply :)

The table was not generated. See in attachment.

Em quarta-feira, 2 de julho de 2014 10h18min27s UTC-3, Rafael Carvalho escreveu:
Hi,

I can now print my result in report.log (), but I would like to build a table inside it with html, how can we insert html in the report?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.



--
Subramanyam

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.