HI How to take screenshots of a Webpage and saving it in a
external word document using QTP.
Answers were Sorted based on User's Feedback
Answer / jegan
''Capture Currently display web page
Browser(objBrow).Page(objPag).CaptureBitmap "C:\Test.bmp",True
''Create word application
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
Set objRang = objDoc.Range()
Set objShape = objDoc.inlineShapes
''Add Picture to word file
objShape.AddPicture ("C:\Test" & ".bmp ")
objWord.Selection.TypeParagraph()
''Save Word File
objDoc.saveas("C:\Test.doc")
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / jkarurosu
I've tried the code and it works fine. I just have a question here, how can I add a second image at the end of the file. I've tried in different ways but the last image appears at the beginning of the file.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / apurva
I am using the above code only.
''Create word application first
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
Set objRang = objDoc.Range()
Set objShape = objDoc.inlineShapes
"Capture Currently display web page
Browser(objBrow).Page(objPag).CaptureBitmap "C:\Test.bmp",True
''Add Picture to word file
objShape.AddPicture ("C:\Test" & ".bmp ")
"Capture Currently display web page
Browser(objBrow).Page(objPag).CaptureBitmap "C:\Test.bmp",True
''Save Word File
objDoc.saveas("C:\Test.doc")
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sumit
Try this Jkarurosu:Use Movedown method
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
'Set objRang = objDoc.Range()
Set objShape = objDoc.inlineShapes
''Add Picture to word file
fname="C:UsersPublicPicturesSample PicturesKoala.jpg"
fname2="C:UsersPublicPicturesSample PicturesTulips.jpg"
objShape.AddPicture (fname)
objWord.Selection.MoveDown 1,0
objWord.Selection.TypeParagraph()
objShape.AddPicture (fname2)
objWord.Selection.MoveDown 1,0
objWord.Selection.TypeParagraph()
''Save Word File
objDoc.saveas("C:UserssunshineDesktopTest.docx")
| Is This Answer Correct ? | 0 Yes | 3 No |
How cookies can be tested in QTP?
1. how can you handle exceptions without using recovery scenario?
WHAT AREV THE STEPS BETWEEN TEST cASE AND Script generation?
Connect to QC using AOM.
without Qtp features can we automated?
Anybody wants to learn QTP with realtime implementations and complete framework desiging plz contact to this mail id ciraaj@gmail.com
Hi .. i want to write the script for the combo nox list . For example if any combo box having a multipul itme. So how can i retrive each item for each iteration ? help me out .
How is recording done when a application is over lapping the QTP application it gives a message object not recorded
Hi we are running tests remotely from quality center and pushing tests into qtp boxes remotely, and it does execution but while uploading results back into quality center it hangs in qtp box.If any one come across similar problem, please send me details how to handle this. Thanks kris
How to merge the two object repositories
how to identify the objects if application consists of objects that have same properties.
I have to pass all the test cases into gmail userid and password using functions please give me code thanks have anice and greate day