title: C# Selenium - Is it possible to loop the same test case that is meant to run for different members?
body: <p>I'm writing a small testing script that will test the same thing for different members on their online profile. My question is, is it possible to loop a test case? At the moment, the way I've been doing this is simply copying and pasting the same test case over and over and changing only the member name variable. But there are a couple hundred members that I need to do this for and I am sure there must be a more efficient way to handle this. Below is the code I written so far please let me know if there is anything I should change or try.</p>
  
  <pre><code>  class Program
    {
  
      string username = "Username1";
      string password = "Password1";
      string url = "http://url.com";
  
  
  
      static void Main(string[] args)
      {
      }
  
      [SetUp]
      public void Initialize()
      {
  
  
          Properties.driverGC = new ChromeDriver();
          Properties.driverIE = new InternetExplorerDriver();
          Properties.driverFF = new FirefoxDriver();
  
  
          UWEAdmin.OIDLogIn(Properties.driverGC, username, password, url);
          UWEAdmin.OIDLogIn(Properties.driverIE, username, password, url);
          UWEAdmin.OIDLogIn(Properties.driverFF, username, password, url);
  
      }
  </code></pre>
  
  <p>---------------THIS IS THE TEST CASE I AM WANTING TO LOOP, THE ONLY DIFFERENCE IN THE TEST WOULD BE THE MEMBER NAME.------------------------------------------</p>
  
  <pre><code>        [Test]
          public void MEMBER1()
          {
              string member_name = "Member1";
              string OU = "American Red Cross of Central";
              string status = "Yes";
  
              OperatingUnit.ChangeOU(Properties.driverGC, OU);
              MemberSearch.Search(Properties.driverGC, name, status);
  
              Compare.statuses(Properties.driverGC);
  
          }
      }
  
  
          [TearDown]
          public void CloseUp()
          {
             Properties.driverGC.Quit();
          }
    }
  }
  </code></pre>