Automatically save pages to PDF from Selenium (OS X)

3,308 views
Skip to first unread message

Gregory Dudek

unread,
Feb 12, 2014, 10:37:22 PM2/12/14
to seleniu...@googlegroups.com
I would like to automatically save selected pages to PDF when specific test conditions arise.
OS X includes a print to PDF option in the print driver, but the system print dialog includes a "print" (acknowledgement) button that I
do not seem to be able to click from Selenium.  Has anybody determined how to do this? 

I am using Chrome, but would be OK with a solution that another browser, although a system-agnostic solution would be idea.

Krishnan Mahadevan

unread,
Feb 13, 2014, 1:54:59 AM2/13/14
to Selenium Users

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7c1d1c2b-9676-418a-bf53-f8560a801c20%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

David

unread,
Feb 13, 2014, 2:07:19 PM2/13/14
to seleniu...@googlegroups.com
You might be able to do it with AppleScript if you can figure out what to execute. Or something like this:


if you knew what to execute again. But perhaps better to do what Krishnan mentioned. But not sure if just pulling the page (HTML) source then running that through PDF generator will give you the desired output because it might not render correctly with images too. So you might need to pass that through HTML2PDF solution.
Reply all
Reply to author
Forward
0 new messages