From the course: Advanced Scripting for Testers: Local Data, Spreadsheets, and Reporting

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Challenge: Creating a PDF report

Challenge: Creating a PDF report

(upbeat music) - [Instructor] I'm going to give you another challenge right away. It's the same challenge as a couple of videos ago, but this time, instead of creating a pie chart in an HTML file, I want you to create it in a PDF. So I've given you the same starting script in the exercise files as you had for the HTML report version of this. But this time, instead of using Jinja and an HTML template, I want you to directly write the data into a PDF file. So we have the same thing here where we have this function that will get us a bunch of random test cases. We'll call that function to get that list. And then you'll need to loop over this to create the data that you need to make this pie chart. It's going to be very similar to what we did with that one. But then instead of using Jinja and writing it into a HTML file, you're going to use Matplotlib and write it into a PDF file. So good luck and have fun.

Contents