0

As part of my continuous integration server, I am running a bunch of performance profiling. If the performance profiling tests don't crash and pass a threshold then it declares them successful. I then manually take the log files, convert them to JSON, plot them in a web browser, then print the page as a PDF. This provides a nice little report as an artifact of the build.

Question I have, is there any way to programmatically launch the web browser, let it render, then print to PDF, then close? I'd like to make this process part of my CI instead of doing it manually. I'm running Ubuntu 16.04, firefox, and prefer to be headless.

My test is producing a bunch of ROS bags (basically log files for those not ROS-initiatied). I then replay the ROS bags into rosbridge (a websocket interface to ROS). My web page has HTML/JS that connects to rosbridge and plots the results in plotly.js (a very nice recently open source'd javascript plotting utility) .

4
  • Have a look at CefSharp and the Chromium Embedded Framework. Commented Aug 4, 2016 at 18:32
  • Have you tries wget? If the service is not interactive, you can pass the url with parms and save the pdf to disc. Commented Aug 4, 2016 at 18:43
  • I thought wget would get the files, but not render. I already have the HTML locally. I want the rendered web page (which is HTML with an embedded plotly.js plot) Commented Aug 4, 2016 at 18:45
  • 1
    Mozilla Firefox accepts a URL as a parameter from the command line. That URL could be https:// of file://. So theoretically you could script at least that. I don't know about generating the PDF programatically from within the browser. Commented Aug 4, 2016 at 19:30

1 Answer 1

3

Perhaps Selenium (a web software testing framework which I heard of, but never used) could be helpful.

1
  • Thanks! I'll take a look at that and let you know how it works Commented Aug 5, 2016 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.