title: How to config app.config to take test data from an excel file using Nunit?
body: <p>I'm trying to create a data driven test using selenium, C# and Nunit. I'm using the app.config to find my excel sheet so that it can run the test</p>
  
  <pre><code>&lt;appSettings&gt;
       &lt;add key="mydatafile" value="DataSource=C:\Users\christophermclellan\theExample.xlsx"/&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>I've set my configuration up as follows </p>
  
  <pre><code>setting = ConfigurationManager.AppSettings["mydatafile"];
  </code></pre>
  
  <p>and reading in my values as follows</p>
  
  <pre><code>xlWorkBook = xlApp.Workbooks.Open(setting, 0, true, 5, "", "", true,Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
  </code></pre>
  
  <p>When I run this in I'm getting the following error </p>
  
  <blockquote>
    <p><em>DataDrivenTestFramework.Driver.GoogleSearch: System.Runtime.InteropServices.COMException : Sorry, we couldn't find
    Data Source=C:\Users\christophermclellan\theExample.xlsx. Is it
    possible it was moved, renamed or deleted?</em></p>
  </blockquote>
  
  <p>If anyone could point me in the right direction of where to go from here that you be great</p>
  
  <p>Thanks</p>
  
  <p>Chris</p>