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 |
What are parameterizing tests?
Hi we are using QTP9.0 for Seibel Application and this seibel application will give you a popup messagebox which is of web , so qtp takes 3 mins to recognize the messagebox and to click on it , we have more number of messageboxes like this . please suggest me some solution
How many types of recording modes in qtp? Which will be used when?
can any one explain with an example how to test Web application using qtp
what is the difference between wait and wait function
What is meant by Step Generator in Qtp How is it used? pls gimme in detail
What is keyword driven Testing Framework. Anybody can explain it in details... Pls anybody can give the answer.. Thanks in advance...
We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we handle this scenario in QTP?
5 Answers Accenture, Banca Sella, Polaris,
how to insert QTP to display errors and other description in the test results instead of halting execution by throwing error in the mid of executin due to an error (for object not found)?
How to catch the TOol Tip Dyanamically changing values using the qtp script by Descriptive Programming Scenario: ======== 1. when i press the submit button 2. The Tool tip first shows the value "Validating...." 3. Next the value is changed in tooltip "Logging....." ------ And the class is webElement SO , how can i catch both values During Run time using Dp
what is the use of descriptive programming in QTP ? when we need to use DP? can we test the application completely with out useing DP?? please explan with example
Hi all, what is the latest version of QTP?