JG Vimalan's Blog

It is all about coding!

Either DataSourceSettingName or ConnectionString and TableName must be specified and cannot be empty.

I got this error when I compiled  my Coded UI test developed in Visual Studio 2010.

This occured after I added data source to my unit test method.  The test method with data source is as shown below,

[DataSource(“Microsoft.VisualStudio.TestTools.DataSource.XML”, “|DataDirectory|\\Source.xml”, “”, DataAccessMethod.Sequential), DeploymentItem(“TestProject1\\Source.xml”), TestMethod]
        public void CodedUITestMethod1()
        {

To fix this issue, provide valid table name as shown below,

[DataSource(“Microsoft.VisualStudio.TestTools.DataSource.XML”, “|DataDirectory|\\Source.xml”, “EmployeeName“, DataAccessMethod.Sequential), DeploymentItem(“TestProject1\\Source.xml”), TestMethod]
        public void CodedUITestMethod1()
        {

This will fix the issue.

May 17, 2012 Posted by | C#.NET, Coded UI Test | 2 Comments