Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to save PDF file using QTP.
10-05-2010, 12:42 AM
Post: #1
How to save PDF file using QTP.

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.
Find all posts by this user
Quote this message in a reply
10-05-2010, 12:36 PM
Post: #2
RE: How to save PDF file using QTP.
what was the problem you were facing when u tried to save the PDF file?
I think u need to use Descriptive programming.
Find all posts by this user
Quote this message in a reply
10-05-2010, 09:22 PM (This post was last modified: 10-05-2010 09:24 PM by karpatylvov.)
Post: #3
RE: How to save PDF file using QTP.
(10-05-2010 12:36 PM)Pallavii Wrote:  what was the problem you were facing when u tried to save the PDF file?
I think u need to use Descriptive programming.

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.
Find all posts by this user
Quote this message in a reply
10-06-2010, 02:04 PM
Post: #4
RE: How to save PDF file using QTP.
Try the following:

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.
Find all posts by this user
Quote this message in a reply
10-06-2010, 10:37 PM (This post was last modified: 10-06-2010 10:37 PM by karpatylvov.)
Post: #5
RE: How to save PDF file using QTP.
(10-06-2010 02:04 PM)Pallavii Wrote:  Try the following:

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.


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?
Find all posts by this user
Quote this message in a reply
10-09-2010, 05:28 AM
Post: #6
RE: How to save PDF file using QTP.
Hi,
Saket's article on PDF is excellent!!!! Its available on Ankur's Learn QTP Blog itself, please check this, it might help youSmile

http://www.learnqtp.com/learnquicktestpd...fs-in-qtp/

Melody
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  QTP gets crashed on start up or on save a script. Pls advise pandeche 2 720 04-16-2012 12:14 PM
Last Post: leema
  Save an Open PDF file mv8167 0 180 04-03-2012 01:45 AM
Last Post: mv8167
  Save File Dialog Testing adsherman 0 287 03-14-2012 12:18 AM
Last Post: adsherman
  Save or Save As not working for QTP 11 Nick 1 764 08-13-2011 12:16 PM
Last Post: vaddevinod
  Save Excel file mv8167 4 1,953 07-14-2011 02:19 AM
Last Post: mv8167

Forum Jump:


User(s) browsing this thread: 1 Guest(s)