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 (387)
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
 
how can we retrieve ten rows from the data table using loop concept?   4
i this is balaji from chennai i have 4 yrs exp in testing and my qualification is bsc computers i completed in correspondace in which companiies accept the correspondace plz let me know Accenture 1
If we are record a same web page for 2 times.1st time it is showing 6 objects in the Object Repository and for the 2nd time it is showing like 7 Objects in the Object Repository why it is happening Kanbay 4
how much space occupies in object respository by default? VSoft 5
How to check the URL using Automation tool QTP   2
if full in Object Repostoiory then how to load other Object Repository   2
how to write vbscript on web applications in qtp. explian with one example? Wipro 4
How to take screenshots in qtp? sonata 2
How to Get the Run-time value of an object under that web app under Test to the local data table sheet of that Action?   2
What are SetToProperty, SetRoProperty, GetToProperty scripting?   4
can we call a test in another test? iFocus 3
After geting the modules where we generate the script ie in qtp or notpad ?   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