title: How can I add a datasource to a UIMap method instead of a Test Method (VS 2010 Coded UI Test)
body: <p>I have a 2010 Coded UI Test that performs some actions against a website.  I am able to add a datasource to a "Test Method" which loops the entire method once per record.</p>
  
  <p>But, what I really want to do is loop only a portion of the test which is just a single recorded method in the UIMap.</p>
  
  <p>Let's say the test method looks something like this:</p>
  
  <pre><code>//[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\TestCommunities.xml", "Community", DataAccessMethod.Sequential), DeploymentItem("Tests\\WebTests\\DataSources\\TestCommunities.xml"), TestMethod]        
  public void LoginCreateCommunities()
      {
          this.UIMap.LoginAdmin();
          //this.UIMap.CreateCommunityParams.UIItem0EditText = TestContext.DataRow["CommunityName"].ToString();
          this.UIMap.CreateCommunity();
          this.UIMap.LogoffClose();
      }
  </code></pre>
  
  <p>It's only UIMap.CreateCommunity() that I want to loop the datasource.  I do not want all 3 methods to execute per record in the datasource, which is what happens when I attach the datasource to the test method (the portion commented out above).</p>
  
  <p>Is there a way to achieve what I'm trying to do here?</p>
  
  <p>Thanks.</p>