title: pass variables as array specflow c#
body: <p>I am attempting to use Specflow to automate web tests using Selenium.  So far, things are going mostly fine, but I am now running into a problem.  One of my steps allow for a user to input a variable, the step looks like this:</p>
  
  <pre><code>     Given I click the (VARIABLE) Menu
  </code></pre>
  
  <p>And the code behind it is fairly simple, just clicking on a link based on the text that is passed:</p>
  
  <pre><code>     driver.FindElement(By.XPath("Xpath to get to the variable")).Click();
  </code></pre>
  
  <p>However, there is a later step that must use this information.  That is fine, you can use "ScenarioContext.Current.Add(string, variable)" and I know about that and have been using it.  It functions for the needs that I was first informed of.</p>
  
  <p>My problem is that now the business wants to be able to add multiple items at the same time.  This presents two problems.  Attempting to just call the step a second time throws an exception: "An item with the same key has already been added." and if I put this into a Scenario Outline, which would allow me to call the variable a second time in a second run, I cannot use the first variable in the final step.</p>
  
  <p>Logically, this means that passing in a variable multiple times is the problem (which makes sense, given it's passing in as a string) and so passing the variable in as an array seems the logical way to go.  The idea is that when I pass the parameter from one step to another as an array instead of as a string I <em>theoretically</em> won't run into this error and then I will be able to iterate through the items in the array in that later step with a for loop.  This seems like something that SpecFlow should be able to do, but I am having issues finding out just how to achieve this.  Does anyone have an idea on how to do this?  I attempted to merely use:</p>
  
  <pre><code>     Scenario.Context.Current.Add(string, variable).ToArray();
  </code></pre>
  
  <p>However, that does not work, and all of the examples of "ToArray" I can find in the SpecFlow documentation doesn't seem to be actually changing the <em>variables</em> you pass from one step to another into an array, it seems to be used solely inside of individual steps and never passed between steps.  Is passing parameters using ScenarioContext.Current.Add(string, variable) as an array possible in SpecFlow?</p>
  
  <p>Thanks in advance.</p>