Ask a Question

Running a Data Driven Test using multiple Keywords and scripts

SOLVED
nedbacan
Frequent Contributor

Running a Data Driven Test using multiple Keywords and scripts

I have a data driven test setup using a Keyword test and scripts included in the main Keyword Test 1.

 

It works, but it will get longer with time, and I'm afraid it may be hard to manage (modify)

 

I am not sure if this is the efficient way of doing it.  Other suggestions? 

 

Can I do the date driven test in the Execution Plan without having all the scripts inside Keyword Test 1?  

 

Some scripts rely on the data entered from Keyword Test 1.

 

Here is my scenario:

 

Keyword Test 1  < Here I define the data driven and then create the data loop

Script 1 

Script 2

Script 3

Script 4

Keyword Test 2

Keyword Test 3

Script 5

Keyword Test 4

Script 6 < adds the data into a spreadsheet>

Script 7 <last script to run with the first data before jumping back to Keyword Test 1 for the next data entry>

9 REPLIES 9
Marsha_R
Champion Level 3

The Execution Plan is used for organizing test items. It doesn't run test items of its own.

https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/execution-plan/index....

 

Are you concerned with the individual tests being too long or that Keyword Test 1 will have a large number of scripts and keyword inside it?  If you give the scripts and keyword tests names that are useful, it should not take long to find the place you need to edit.

rraghvani
Champion Level 3

If I understand correctly, you are reading data from a spreadsheet, performing some tests, and then adding data to the spreadsheet you are reading from?

 

 

nedbacan
Frequent Contributor

Yes that is what it is doing, and I am wondering if there are other methods of doing this than just keep adding scripts or keywords into the master keyword test. (Keyword Test 1).

rraghvani
Champion Level 3

I don't quite understand why you need to update the main spreadsheet during playback. Ideally, this is not how data driven testing is done.

 

 

nedbacan
Frequent Contributor

I am sorry. I missed read your question before.  I am reading from a spreadsheet where the data to be added to my test scenario and my results (i,e, timestamps, generated ID and so on) are being added to another spreadsheet.    

 

rraghvani
Champion Level 3

Ah ok. That's fine then!

 

When you say "It works, but it will get longer with time, and I'm afraid it may be hard to manage (modify)", what makes you think it will become difficult to manage? Is it the keyword tests, scripts tests or data?

nedbacan
Frequent Contributor

Maybe not hard just that I don't want to create a very long test in one. So I was just wondering if there are other methods I can use, if not I can live with a big script. 

 

My verification:

There is a workflow  the user needs to go through within the software once he creates an order, so that order is taken through several stages in the software to get the order close, so in my case each stage contains several (scripts/keywords) tests and so on.  I am using data driven data to create many orders so at the end the results can be checked in the spreadsheet. 

 

I put out the question if in case someone had come up with other ways of doing Data Driven verifications.

 

rraghvani
Champion Level 3

Understand. I guess in certain situation, like yours, there's no easier solution. I can only suggest to insert suitable comments, make the coding as readable as possible, and make functions not too complicated.

 

Even the example from SmartBear, https://services.smartbear.com/samples/TestComplete15/smartstore, follows similar process.

At some point, you have to have a master test. Breaking tests into smaller and smaller groups ends up making things more difficult over time. Name your tests clearly, whether scripts or keyword tests, and it will work out fine.

cancel
Showing results for 
Search instead for 
Did you mean: