Forum Discussion

techgirlbb's avatar
techgirlbb
Contributor
7 years ago

Reusing the same scripts by point different data loop excel files

I have created reusable Keyword scripts for 10 forms and inserted data loops where ever needed and using Excel sheet for input values.

We have 5 products each product will be reusing the above scripts. Data loop excel has 5 rows if unique data one for each product.

Currently executioner is updating the row# of data Loop of corresponding Keyword scripts whichever the product they want to run

It is becoming tedious as we are growing in # of scripts with data loops.

I am looking for creating different excel one of each product data and pointing same keyword scripts. Just run rather than updating data loop# scripts each time?

Do not want to clone the scripts for each product and point to file because of maintenance issue

Is there another option for me?

 

7 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    So, let me see if I understand.

     

    You have a reusable keyword test with one of these data loops.  the data loop points to an excel sheet.  That excel sheet has 5 rows.  You have 5 products you're testing.  When you run a test for product 1, you go in and edit your tests to use row 1 through row 1.  When you run a test for product 3, you edit the test to use row 3 through row 3.

     

    So... in other words, they aren't exactly loops but simply external storage of parameters to be used for the test case.  You're not looping, within the test case, for all 5 products.

     

    What I would do, actually, is instead of using a data loop, add parameters to your keyword tests and then use those parameters instead of data loops.  When you add the resuable keyword test to a project for, for example, product 4, you would simply use a different set of parameters rather than having to point to an excel sheet.

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

       

      You could even keep your Excel file because that makes it easier to change data without changing it in the test parameters every time, but use tristaanogre's parameter idea for accessing the Excel data.

       

      Use a parameter called TestNumber or something and then set your test to use Excel.TestNumber (not the real syntax!) to get the row for the test.  Then each test has it's own parameter value and row and you never have to change it.

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

      Oh wait, you don't want to clone the scripts.  You shouldn't have to change the test number every time, that's definitely tedious.  Can you give us a more detailed example of how this would be run on a daily basis?

      • techgirlbb's avatar
        techgirlbb
        Contributor

        Marsha, Thank you for trying to help with my current issue. Here is some more information:

        we have around 20 products and each product contains has min 10 to 14 screens based on product selected. so I have created individual keyword scripts so that I can reuse them using script routine for each product. 

        I did not go with approach of creating one script all through 15 screen to work data loop, because flow is not same across all the products.

         

        As well these products are run by couple of team members at the same time from their systems  by sharing products

        like executioner 1- from 1 to 10 products

        like executioner 1- from 11 to 20 products

         

        I generated the script(Java script) for keyword tests that has Data loop. I am not seeing the file name that I have provided using data loop wizard.

        Is there an option for me to utilize the Java script  and passing the different files?

        Pls find the attachment which we have in currently..

         

         

         

        I though of calling the keyword script and passing