Forum Discussion

nedbacan's avatar
nedbacan
Frequent Contributor
2 years ago
Solved

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>

  • 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.

9 Replies

  • Marsha_R's avatar
    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.html

     

    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's avatar
    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's avatar
      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's avatar
    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's avatar
      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's avatar
    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's avatar
      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.

       

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        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.