Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How to capture data from images in QTP and produce them in Excel sheet ?




373
views
asked marvit August 20, 2014 03:12 AM  

How to capture data from images in QTP and produce them in Excel sheet ?


           

1 Answers



 
answered By Dharma   0  
Using below code u can capture data from Image and Produce them in XL.

Browser("name:= Browser name*").Page("title:=page title").Image("html tag:=IMG","name:=Image","alt:=alt property value").Exist

Browser("name:= Browser name*").Page("title:=page title").Image("html tag:=IMG","name:=Image","alt:=alt property value").Highlight

sText= Browser("name:= Browser name*").Page("title:=page title").Image("html tag:=IMG","name:=Image","alt:=alt property value").GetROProperty("text/name/alt")

 

'Create a new Microsoft Excel object

Set myxl = createobject("excel.application")

 'To make Excel visible

 myxl.Application.Visible = true

myxl.Workbooks.Add

wait 2

 

set mysheet = myxl.ActiveWorkbook.Worksheets("Sheet1")

mysheet.cells(1,1).value =sText

'Save the Excel file as qtp.xls

myxl.ActiveWorkbook.SaveAs "C:\qtp.xls"

'close Excel

myxl.Application.Quit

Set myxl=nothing

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert