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 explain a claims and insurance project?

0 Answers  


How can i use virtual objects? If have i created one new virtual object in a virtual object manager by following instructions.

0 Answers  


In web page there is five OK buttons available, while recording i click on 3rd OK button, How QTP identify the 3rd OK button while running script? Is qtp identify 3rd ok button?

14 Answers   Polaris,


Is QTP supports Unix. If yes, then how the test automation is done?

0 Answers   iFlex,


I'm quite new at QTP. Im doing a web-based app testing. I create something new item and a new link is created in the home page. This link is dynamic as it changes every 3 seconds. Obviously the new link is not in my Object Repo and I am trying to find a way how can I do a check or get the propery of the link I created. I can do it on keyword, but I need to do a check on expert mode, vbscript. I always get an error that is not identified whenever i try to check it (browser(b),page(p).link(newlink). Any idea?

4 Answers  






What are objects? how do you select the unknow object?

3 Answers  


Write script to fetch the data from global sheet where row number is 3 and parameter is "text"

3 Answers   Thomson Reuters, Accenture,


How to capture a window in QTP?

0 Answers   IBM, Mphasis,


How to add a runtime parameter to a datasheet?

1 Answers   Crea,


How will you load few objects in Active Screen?

1 Answers  


what is Automation frame work and how do u used this for your project?

3 Answers  


How can i click on any Excel sheet's "H" column with out writing coordinates Ex:Window("Book1").WinObject("Book1").Click 498,14 I dont want to give coordinates like 498,14 Can i open "H" column by writing like Ex:Window("Book1").WinObject("Book1").Click "H" or Ex:Window("Book1").WinObject("Book1").Click "H","1" or Ex:Window("Book1").WinObject("Book1").Click H,1 If i want to click on "Sheet3" of an excel sheet, Can i open like Ex:Window("Book1").WinObject("Book1").Click "Sheet3" Please help me any one

0 Answers   Livetek,






Categories