Micro Focus QTP (UFT) Forums
How to extract value from apps output and populate in spreadsheet - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to extract value from apps output and populate in spreadsheet (/Thread-How-to-extract-value-from-apps-output-and-populate-in-spreadsheet)



How to extract value from apps output and populate in spreadsheet - Lekha Das - 11-09-2011

I am using qtp to provide some input value to an application.
The web application has few input fields.
After clicking enter( in the app) as a result, the app returns me some values which has row name and then the value. Example
Input field is "PersonId" and value I provide is 11
PersonId: 11

Output field is FirstName and LastName and values are as follows

FirstName Lekha
LastName Das

I need to capture this output data and populate it in either spreadsheet
or in some kind of table format. Can someone help me in providing the info how can i use qtp to do that. My email is lekha_das@yahoo.com if you like to email. I am using qtp11.
Thank you


RE: How to extract value from apps output and populate in spreadsheet - PrabhatN - 11-10-2011

Hi Lekha,

Have you tried spying on the area where these output values are displayed in the application? If it is a webtable, your job gets easier.

If it is a webtable:

I am giving example for "FirstName Lekha" type.

Code:
getRowCount = Browser("").Page("").WebTable("").GetROProperty("rows")
For counter = 1 To getRowCount
     DataTable.SetCurrentRow(counter)
     DataTable("Column1",dtLocalSheet) = Browser("").Page("").WebTable("").GetCellData(counter,1) //It will give you FirstName/LastName i.e values present under 1st column
     DataTable("Column2",dtLocalSheet) = Browser("").Page("").WebTable("").GetCellData(counter,2) //It will give you Lekha/Das i.e values present under 2nd column
Next
DataTable.SetCurrentRow(1)

Hope this helps you.