Open kazurayam opened 1 year ago
I installed wkhtmltopdf by
$ brew install wkhtmltopdf
This just worked.
$ cd ~/katalon-workspace/waitForElementNotPresentWorksOrNot/Reports/20230827_101110/TS1/20230827_101110
$ wkhtmltopdf 20230827_101110.html 20230827_101110.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
I got this PDF file.
This looks just nice.
But regretfully enough, the divs are collapsed. I need to find out a way to show all the collapsed divs before converting the page into PDF. Possibly I can find a way to inject a javascript to do the job. The html may accept an URL parameter to show the divs.
The HTML report has the following anchor
<a class="expand" title="Expand this suite fully" href="javascript:expandAllChildren('s1')" onclick="stopPropagation(event)">Expand All</a>
By clicking this, you can expand all divs.
or by executing expandAllChildren('s1')
as well.
There was a post
Katalon produces a report in PDF report, but the report is something broken.
I searched Google how to convert a HTML to PDF. I found
It looks promissing. Why not using wkhtmltopdf?
In this waitForElementNotPresentWorksOrNot project, I will evaluate the wkhtmltopdf command so that I can generate a PDF file which is derived from the Katalon Test Suite execution report as HTML.
I will do