Forum Discussion

LRuoc's avatar
LRuoc
Contributor
3 years ago

Data Loops

Hello All

 

I have developed a script that searches a list from entering a word in a search box. I want to parameterise this search by using a Excel Spreadsheet so that each iteration selects the next row on the spreadsheet.

 

I select the code in the keyword script and put in a Data Loop which has 3 rows in it. I select the param name to select from but this fails. What happens is when I play it back, all 3 rows are typed into the search box.

 

Does anyone know why? I want each iteration to select a different row so there are 3 different searches.

 

Thank you for your help.

3 Replies

  • Hi LRuoc 

     

    Hope you are well. 

     

    I would use test parameters in this instance. 

     

    The loop should work it may be due to the loop configuration itself(start and end of the loop) 


    Based on your description you only want to use a parameter value, do you want to then call a parameter value when running a test?  

    If so then maybe using test parameters, storing these in TC maybe a better alternative. 

     

    https://support.smartbear.com/testcomplete/docs/keyword-testing/parameters.html

     

    Let me know how this goes 

     

    Thanks 

     

    Vinnie

     

     

    • LRuoc's avatar
      LRuoc
      Contributor

      Hi

       

      Thanks for your reply.

       

      It is a program called Software Center than I am testing. It works by entering a keyword in a search box then on pressing enter, the results show what version is installed.

       

      I want the script to iterate using different keyword searched so though Data Loop would be better than test parameters. Can I do this with test parameters?

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    all 3 rows are typed into the search box.

    Does this happen on first loop iteration?

    It is possible that you need to clear search box before entering search data into it.