0

我有以下问题。

我需要连续运行 10 个测试 - 由 excel 工作簿驱动。每行是一个测试用例。

我的问题是当我添加以下行时:

[DataSource("System.Data.Odbc", 
            "Dsn=Excel Files;Driver={Microsoft Excel Driver (*.xls)};dbq=|DataDirectory|\\RecordedSteps\\Input.xlsx;defaultdir=.;driverid=790;maxbuffersize=2048;pagetimeout=5;readonly=true", 
            "List1$", DataAccessMethod.Sequential), TestMethod]

它在一个测试用例中迭代 excel 工作簿。

我需要的是阅读一行excel工作表,填写输入并完成测试用例等等......

4

1 回答 1

0

The [DataSoure(...)] and [TestMethod] attributes apply to the method that immediately follows them. The [DataSoure(...)] attribute instructs Coded UI to run the method a number of times; once for each set of data, eg for each row in a spreadsheet.

To run 10 different tests requires 10 methods each having a [TestMethod] attribute. Any of these methods can be data driven, but will need their own [DataSource(...)] attributes.

于 2014-10-06T19:47:54.730 回答