Feeding the test iteration from database - non descriptive way? - 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: Feeding the test iteration from database - non descriptive way? (/Thread-Feeding-the-test-iteration-from-database-non-descriptive-way) |
Feeding the test iteration from database - non descriptive way? - sepgs2004 - 01-19-2010 Hi I am a beginner. This is my requirement: Just before the test starts or as a first step in the test, test has to go to database, issue a select query, get rows of values into the global data table, then run the test iterations using each row of the global data table. My test actions will have parameters pointing to the data at a certain column of the global data table. This is what I have tried so far: 1. Importing data from database into global data table. On the global data table, when I right clicked, I saw an option (Sheet->Import->From Database) to import from database. I could not figure out if this is dynamic; I mean, every time I run the test, does the sheet get filled by re-running the query? Or does it save the data once and for all with the test itself?. Does anyone know? I also see a (Data->ReCalc) option when right-clicking on global datasheet. Does this apply only to data table sheet formulas or also to importing from database? 2. Insert output Value -> Database output value Can this be used for my scenario? If yes, could you give me some key pointers on how? ------------------------- After looking through some threads, I found in this forum, some descriptive code that opens a connection, runs a query, gets values from database and fills into the global data table. I would prefer to do it non descriptive way (using menu options, etc) if its possible. Thanks for your time. RE: Feeding the test iteration from database - non descriptive way? - sepgs2004 - 01-20-2010 I could not define and use a Database Output value for my purpose. Or I do not know how to do it. This is my insight 1. Using Output Value Every Output value, even if there exists multiple rows as a result of the select query, map/point always to a new column in the first row of the data table. So this would correspond to only one iteration of the test (no matter how many rows we get as a result of our SQL query). I was expecting something like, if I get 5 rows as a result of my database query, correspondingly I would like to map each row to a row in the data-table and I would like to have 5 iterations in the test. 2. Using data-sheet import from database Also when I try to use the import feature in data-sheet, it is static. So next time I run, I have to redo import to get the latest data. This kind of concludes like, the only way to map each result row of sql query to a row in data-table is through descriptive (script) programming. Since I am new to QTP, please advise me if I am missing anything Thanks |