Quality Testing

Quality is delighting customers

How to capture data from image in qtp? And produce them in XL sheet?

1)How to capture data from image in qtp? And produce them in XL sheet?

Views: 1429

Reply to This

Replies to This Discussion

Try this method.

BmpPath="C:\AFW\"&Screenshots\Test.bmp"
Browser("Browser").FullScreen
Browser("Browser").CaptureBitmap BmpPath,True
Call UpdateResultSheet("","","","Fail",BmpPath)

 

 

Hi Chethan,

Thanks for the reply, Sorry yar i didn't the ans...can u explaing more clearly...if u don't mine.

Hi Venkata,

 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

 

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service