There are Excel commands available within QTP. Create the Excel object, then you can perform an Excel.Export function.
Where do you have your expected results? Are they also in an Excel file? If so, you could attach that Excel file as your DataSheet. Then you would simply be able to compare specific values from your application to the values contained within the datasheet.
1. When I run my script tomorrow will it overwrite the row of data that was just written to the excel document? If so how can I force QTP to check and see if that row has any data, if it does to keep checking for an emapty row then imput data there?
2. So far I have exported the data for "DateEntered". Next I will export "Customer #" into the same excel document but under a different column name. That shouldn't be a problem right? The data will come from the same script and iteration.
3. By the way, I already had this excel document created, but when QTP exported the data to the excel document it over wrote the column headers I already had in there. Why is that? It should have only created a new datasheet within QTP.
1) Iterations within the script should increment the line number. You can check for an empty row by using a while statement saying while the value of the field in the current row is not blank, increment the row number and retrieve the value again. Once it retreives a blank value, set the row to the current row.
2) The is no problem with writing data to the same row in a different column
3) Did the Column Headers match? Were they in the same order? QTP will export exactly what it has, including its column headers.
I have a similar scenario. But i need to populate data in Excel from a dynamic Webtable. When I populate in spreadsheet every iteration data is replacing the old data but i need old data too . how to overcome this ?? do i need to say while the value of the field (Excel sheet field)in the current row is blank populate the data /// Do you have any sample code >?