Micro Focus QTP (UFT) Forums
CaptureBitmap - File name from Data Table - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: CaptureBitmap - File name from Data Table (/Thread-CaptureBitmap-File-name-from-Data-Table)



CaptureBitmap - File name from Data Table - nagappank - 02-28-2011

In using CaptureBitmap function

1. File names have to be taken from a DataTable value

Can any body help me out with syntax?
-------------------------------------------------------------------------
Code:
Browser("Google").Page("Google").CaptureBitmap("english.bmp")
Reporter.ReportEvent micDone,"lang name","lang desc","english.bmp"


Values in the Data Table as

English
french
German
polish
-----------------------------------------------------------------------




Thanks in Advance
Nagappan


RE: CaptureBitmap - File name from Data Table - manishbhalshankar - 02-28-2011

Hi,

Try the following:
Code:
Dim fileName
fileName = DataTable.GlobalSheet.GetParameter("FileName") & ".bmp"
Browser("Google").Page("Google").CaptureBitmap(fileName)
Reporter.ReportEvent micDone,"lang name","lang desc",fileName

Rename the column of DataTable as FileName in which your values are stored.



RE: CaptureBitmap - File name from Data Table - basanth27 - 02-28-2011

Two questions,
1. Where would it store?
2. Why use variable fileName?


RE: CaptureBitmap - File name from Data Table - nagappank - 03-01-2011

Thanks a lot guys.
Nag


RE: CaptureBitmap - File name from Data Table - manishbhalshankar - 03-01-2011

Hi Basant,

You are right. We can use: CaptureBitmap(DataTable.GlobalSheet.GetParameter("FileName") & ".bmp")