mikev
13 years agoContributor
Data Driven Projects, Tests & Frameworks
New customer of TC, migrating tests from QTP. So far, so good, but I'd like a little review by folks who have been using the tool for quite sometime. I'll try and be as clear as I can, but keep in mind that I'm new to the tool, and I may not know the correct TC terminology.
Let's say that we have an application (doesn't matter what kind really, but in my case it's a Java Application), and that application has a main frame with 6 tabs. Each tab has MANY (20+) objects on it. A single instance of a test will basically launch the application, set all the parameters (by each tab) save the "instance", run the calculations, and finally comparing the output files.
This kind of test is a prime candidate to make use of the data-driven aspect. Since there are so many tabs, and there are so many possible parameters, I have an excel spreadsheet, that has 6 sheets contained in it - and each sheet corresponds with the appropriate application tab.
After looking at the Help, etc, I can easily create the driver and loop through every row for each sheet. That's the easy part. The problem that I have is that each iteration must use the same row from every sheet and every application tab. I certainly could make one huge spreadsheet, and one huge test script, but based upon my testing experience, that's not such a great idea. A nightmare to maintain. This might be representative of a single iteration as I see it:
tab1 -> sheet1 -> row1
tab2 -> sheet2 -> row1
tab3 -> sheet3 -> row1
tab4 -> sheet4 -> row1
tab5 -> sheet5 -> row1
tab6 -> sheet6 -> row1
For the next iteration, this would be the flow:
tab1 -> sheet1 -> row2
tab2 -> sheet2 -> row2
tab3 -> sheet3 -> row2
tab4 -> sheet4 -> row2
tab5 -> sheet5 -> row2
tab6 -> sheet6 -> row2
The rest of the iterations would be the same, with only the row incrementing. I'm not sure how to do that, since my research (so far) only provides for EOF for the Driver. I don't know of any way to get the current row or number of rows, or how to set the row. I'm not even sure if this is the right way to attack this problem, but it worked very well using QTP.
Now, in addition to the above problem, I'm also a little confused about the project layout and the framework of the tests themselves. For example, I'd like to have a set of scripts that do the following:
Startup - Launches and initializes the application. This should only happen once.
Tab1 - Fills out the parameters on tab1. This should happen for every instance of the datasheet.
Tab2 - Fills out the parameters on tab2. This should happen for every instance of the datasheet.
Tab3 - Fills out the parameters on tab3. This should happen for every instance of the datasheet.
Tab4 - Fills out the parameters on tab4. This should happen for every instance of the datasheet.
Tab5 - Fills out the parameters on tab5. This should happen for every instance of the datasheet.
Tab6 - Fills out the parameters on tab6. This should happen for every instance of the datasheet.
Calculate - Creates the output files. This should happen for every instance of the datasheet.
Comprae - compares the output files against a baseline. This should happen for every instance of the datasheet.
Teardown - kills the application. This should only happen once.
So how would you structure this in the Project Suite? My Project Suite is named after the AUT. The Project is what kind of tests will be there. For this example, I use the term Scenario for my Project, as this kind of tests is what we define as a scenario test. Now, I can have multiple scripts (obviously) in the Scripts "item" inside the Scenario Project. But I'm not sure that's what is best, given what I've explained above. Should each "tab" be it's own project? I'm just not sure what the best practice is to do what I'm trying to do.
Anyway, sorry for the length, I'm trying to talk with someone in support, but no response yet. I don't think I'm the only person who does this kind of testing, and I'm sure someone has solved this problem.
Thoughts?
Let's say that we have an application (doesn't matter what kind really, but in my case it's a Java Application), and that application has a main frame with 6 tabs. Each tab has MANY (20+) objects on it. A single instance of a test will basically launch the application, set all the parameters (by each tab) save the "instance", run the calculations, and finally comparing the output files.
This kind of test is a prime candidate to make use of the data-driven aspect. Since there are so many tabs, and there are so many possible parameters, I have an excel spreadsheet, that has 6 sheets contained in it - and each sheet corresponds with the appropriate application tab.
After looking at the Help, etc, I can easily create the driver and loop through every row for each sheet. That's the easy part. The problem that I have is that each iteration must use the same row from every sheet and every application tab. I certainly could make one huge spreadsheet, and one huge test script, but based upon my testing experience, that's not such a great idea. A nightmare to maintain. This might be representative of a single iteration as I see it:
tab1 -> sheet1 -> row1
tab2 -> sheet2 -> row1
tab3 -> sheet3 -> row1
tab4 -> sheet4 -> row1
tab5 -> sheet5 -> row1
tab6 -> sheet6 -> row1
For the next iteration, this would be the flow:
tab1 -> sheet1 -> row2
tab2 -> sheet2 -> row2
tab3 -> sheet3 -> row2
tab4 -> sheet4 -> row2
tab5 -> sheet5 -> row2
tab6 -> sheet6 -> row2
The rest of the iterations would be the same, with only the row incrementing. I'm not sure how to do that, since my research (so far) only provides for EOF for the Driver. I don't know of any way to get the current row or number of rows, or how to set the row. I'm not even sure if this is the right way to attack this problem, but it worked very well using QTP.
Now, in addition to the above problem, I'm also a little confused about the project layout and the framework of the tests themselves. For example, I'd like to have a set of scripts that do the following:
Startup - Launches and initializes the application. This should only happen once.
Tab1 - Fills out the parameters on tab1. This should happen for every instance of the datasheet.
Tab2 - Fills out the parameters on tab2. This should happen for every instance of the datasheet.
Tab3 - Fills out the parameters on tab3. This should happen for every instance of the datasheet.
Tab4 - Fills out the parameters on tab4. This should happen for every instance of the datasheet.
Tab5 - Fills out the parameters on tab5. This should happen for every instance of the datasheet.
Tab6 - Fills out the parameters on tab6. This should happen for every instance of the datasheet.
Calculate - Creates the output files. This should happen for every instance of the datasheet.
Comprae - compares the output files against a baseline. This should happen for every instance of the datasheet.
Teardown - kills the application. This should only happen once.
So how would you structure this in the Project Suite? My Project Suite is named after the AUT. The Project is what kind of tests will be there. For this example, I use the term Scenario for my Project, as this kind of tests is what we define as a scenario test. Now, I can have multiple scripts (obviously) in the Scripts "item" inside the Scenario Project. But I'm not sure that's what is best, given what I've explained above. Should each "tab" be it's own project? I'm just not sure what the best practice is to do what I'm trying to do.
Anyway, sorry for the length, I'm trying to talk with someone in support, but no response yet. I don't think I'm the only person who does this kind of testing, and I'm sure someone has solved this problem.
Thoughts?