I wanted to clarify the process I need to follow to do the following:
QTP should be able to select various conbinations from 4 to 5 drop downs and pull the required Dollar value from the database and calculate the total.
1) Do I need to write separate scripts for each combination and pull the dollar value from the database and output the value?
2) Can I write one script which will automatically select various combinations and pull the value from the database and output the results?
You can probably do this all in one parameterized script.
Put your data into the local datatable for the script. Column 1 is the first dropdown list value, column 2 is the second dropdown list value, etc. Then each row is a separate iteration through your script, so row 1 has all the values for the dropdowns for your first test, row 2 has all the values for the second test, etc.
Write the SQL to use those same values and query your database to get the expected result from the database. Add the SQL to your script. Store the query result in a variable. There are lots of threads on this forum to explain how to add SQL to your script.
I am guessing that your application displays some value that is based on what selections were made in all those dropdown lists. Get this value with a GetROProperty and store it in a variable.
Compare the SQL result variable to the GetROProperty variable and pass or fail based on whether they match. Use Reporter.ReportEvent for this.
Make sure your script is set to "Run on all iterations" so that once it finishes with one row of your datatable it will automatially go on to the next row, and keep iterating until it runs out of rows.
Except for embedding the SQL, this is fairly basic functionality for QTP, so it should all be pretty simple to work out. You might want to search the forums for the SQL part.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"