Forum Discussion

Xman1's avatar
Xman1
Occasional Contributor
7 years ago

Is it possible to run a data loop with keyword tests inside the loop?

I want to run a data loop to test the same actions but in two different websites. However, when I make the data loop, my keyword tests are not included in the loop.

  • OK... what I would do is this:

     

    1) Step one in your data driven loop is to set a project level variable to equal the URL that you get from the loop data.

    2) Then, in your different keyword tests, whenever you need to reference the URL, use that project level variable.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Short answer: Yes.

     

    Pleased describe how you implemented your data loop so we can help debug what's going on.

    • Marsha_R's avatar
      Marsha_R
      Moderator

      Show us a screenshot of your code for the loop if you can.  Sounds like something might be indented wrong and that will mess  your loop up bad.

    • Xman1's avatar
      Xman1
      Occasional Contributor

      I have a keyword test that logs into a website and I have a data loop that changes the URL. I then put in a couple of keywords tests that interact with the website, however, the loop just does the login and doesn't loop that actions for both websites.

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Can we see the code please?  This high level doesn't really help us help you.