ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Testing >> Automation Testing >> QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions (496)
 Load Runner interview questions  Load Runner Interview Questions (486)
 QTP interview questions  QTP Interview Questions (3506)
 Test Director interview questions  Test Director Interview Questions (161)
 Rational TestSuite interview questions  Rational TestSuite Interview Questions (106)
 Silk Test interview questions  Silk Test Interview Questions (59)
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions (386)
Question
HI How to take screenshots of a Webpage and saving it in a
external word document using QTP.
 Question Submitted By :: QTP
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
''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 ?    8 Yes 1 No
Jegan
 
Answer
# 2
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
Jkarurosu
 
 
 
Answer
# 3
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 0 No
Apurva
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
what is aregular expression? UHG 4
How can we close all webbrowsers which are opened in out desctop?   7
difference between multiple parameterization and data driven wizard in QTP?   1
who is the best faculty in Hyderabad for QTP? IBM 44
Hi What are re-usable actions in QTP? -Thank You Siemens 5
How to "Turn Off" QTP results after running a Script? Crea 3
what is the diff between Procedure and function iFlex 3
what is the Command used to start the QTp from Run.   7
When u ll use Record Button in QTP?Is VB script is Mandatory in QTP? What is Meaning of Frame("v1")? TCS 1
hi, In A Table there are some columns and dynamic rows and in each row in first column there is a link with name. upon clicking on that link it will show some details. write the vbscript to check that link without descriptive programming? HealthAsyst 2
How to watch currnet value of an object like OK buton or edit box with "Agent Name:" label. in watch expression tab? Cap-Gemini 2
I added 5 edit box objects in OR.i run the script and the first edit box successfully executed.But on next day when i executed same script for second edit box,it gives an error "object not Found". But when i used Highlight in app. object already in OR.So how i will handel this type of error. Hi please inform me the write answer.Its urgent. TCS 1
 
For more QTP Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com