QTP Forums

Full Version: How to extract value from apps output and populate in spreadsheet
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
Reference URL's