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



HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

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

HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

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

HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

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

HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

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

Post New Answer

More QTP Interview Questions

how to lunch the application in the qtp tool ?

3 Answers  


How to connect to the Database from QTP?

10 Answers   DB, Thatavarti Technologies, Xchanging,


what is On Error Resume Next ?

1 Answers   Accenture,


How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric

0 Answers  


draw the qtp frame work?

0 Answers  






how can we handle exceptional handling in qtp

6 Answers   NIIT,


Is there anyway to have QTP go into a website and map out every object before I actually record any tests? I basically want to map out a website with all the objects and build a complete repository. The reason is because I'm running into issues with hierarcical objects. for example: Browser("ABC company- Home").Page("ABC company - Home").Link ("About Us").Click Browser("ABC company - Page 2").Page("ABC company - Page 2").Link("About Us").Click Both these links ("objects" and I use that term loosely as I'm trained mostly in OO programming) go to the same place but but the object heirarchies (pages) are different. I want a repository that will find any possible link on any possible page without having to manually record it. Is there a way to do this?

1 Answers  


Explain the difference between check point and output value?

0 Answers  


How to find duplicates in an array and remove them efficiently?

2 Answers  


i did B.Tech cse and i secured 76%. instead of siting at home ... i would like to do some course. can u suggest me in this.

1 Answers  


Please explain the role of Regular expression in QTP

0 Answers  


Sql questions to find second max salary and how to use joins

0 Answers   Deloitte,


Categories