Forum Discussion

Lee_M's avatar
Lee_M
Community Hero
4 years ago

Data driven loop round collection of variables

I have a test that is made up of 3 parts

  1. Log in
  2. test for the correct user
  3. Log out

 

Log in passes URL as a parameter, the test works fine.

 

I now have 2 environments:
Live and test on different URLs - both MUST URLs be stored as separate string vars (liveUrl, testUrl)

Given that both environments share the same credentials,  is there any way to loop these so they share the same test?

 

a DDT loops using a var (excel sheet, table, DB)

 

How can I loop round the 2 vars

 

The only way I can work around this problem is to programmatically populate a table var with these 2 separate values before runtime

 

Does anyone have any solutions/suggestions on this problem?

  • Use an Excel sheet to store the URLs and DDT loop to step through the sheet.  Login reads the sheet, gets the URL, then continues on.  DDT loop repeats this for each line in the sheet, so it could be 2 URLs or 100.

    • Lee_M's avatar
      Lee_M
      Community Hero

      This is just working the problem from a different angle

      I still need a script to pull out the variables into separate instances

       

      I need var1, var2 for other users to see and reference - I can't have them digging through CSV files as this could make this

       

      but thanks for the suggestion

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Lee_M wrote:

        This is just working the problem from a different angle

         

         


        Yes, it is.  Since we are guessing at what you really want to do, all we can do is offer alternatives.

         

        I myself don't understand how accessing a data file with two URL entries is asking someone to dig through a file, but I guess that's just me.  I would consider that to be safer than asking them to change a variable or table value in TestComplete.

         

        Good luck with your script!