Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to save PDF file using QTP.
#1
Solved: 10 Years, 9 Months, 1 Week ago
Hi guys,

I need help how to save PDF file using QTP.

In my application user generate PDF (script is ready); when PDF is open I need just save PDF on any drive. I try to record and play back, but don’t work for me.


Regards,
Gene.
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
what was the problem you were facing when u tried to save the PDF file?
I think u need to use Descriptive programming.
Reply
#3
Solved: 10 Years, 9 Months, 1 Week ago
Thanks for reply.

The problem is that QTP were not able to see save button or file - save as option to save PDF.
I am beginner in QTP so for me Descriptive programming is WOW!
Could you please help me with that? I need any options (save button or file - save as) just to save PDF.

Regards,
Gene.
Reply
#4
Solved: 10 Years, 9 Months, 1 Week ago
Try the following:

Code:
Window("<your pdf window name>").Click
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "%{F}"        ' Press ALT+F
WshShell.SendKeys "{a}"              ' Send the corresponding letter which is underlined, for 'save' under 'File' Menu. This opens a 'save a copy' dialog box
Window("<pdf window>").Dialog("Save a Copy").Click
Window("Adobe Reader").Dialog("Save a Copy").WinEdit("File name:").Set "<File Path>"
Window("Adobe Reader").Dialog("Save a Copy").WinButton("Save").Click
Set WshShell = Nothing

Let me know if u face any issues in object identification.
Reply
#5
Solved: 10 Years, 9 Months, 1 Week ago
Thank you very much for code.
You are correct, I have a problem with window name object identification.
Below you can see PDF URL:

lifetimewealthanalyzer.com/lwp_pa/write/LWP_PA_109399_Current.pdf

Number 109399 is unique and always change. What should I do?
Reply
#6
Solved: 10 Years, 9 Months, 1 Week ago
Hi,
Saket's article on PDF is excellent!!!! Its available on Ankur's Learn QTP Blog itself, please check this, it might help youSmile

https://www.learnqtp.com/learnquicktestp...fs-in-qtp/

Melody
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to find and change text in PDF document using QTP UFT automation VBscript alexwhite 0 11,911 02-18-2017, 04:20 AM
Last Post: alexwhite
  Extract and save a file from zip folder using VB Script karthicksri07 1 6,193 06-29-2016, 02:19 PM
Last Post: Ankesh
Shy 5 Save button QTP Qtpnew 1 2,230 09-03-2015, 09:52 AM
Last Post: supputuri
  How to Export run result viewer with CAPTURED DATA and save it in PDF,or Doc,or HTML akhandesh 0 2,805 07-16-2015, 06:03 PM
Last Post: akhandesh
  Unable to Save a file in UFT 12.0.2 (Sequence contains more than one matching elemen) noeldsouza89 0 2,490 02-02-2015, 03:03 PM
Last Post: noeldsouza89

Forum Jump:


Users browsing this thread: 1 Guest(s)