Data-driven unit test-an exception occurs when the unit test adapter is used.

Source: Internet
Author: User

Original article published on
We are doing this todayData-drivenOfUnit TestEncountered a problem during the experiment.

I have created an Access database and an Excel table as an experimental data source for data-driven testing.

After a long time in the app. config file, I took a sigh of relief and finally began to write and test.

Compared with the twoDatabaseAfter the unit test, I opened the test view with confidence to run two tests.

As I expected to pass the unit test on Excel, the next one encountered a problem and an error occurred:

Unit Test Adapter exception: system. Data. oledb. oledbexception: Unrecognized

Database Format: 'C: \ Documents and Settings \ wanghuahau \ Desktop \ testdatasource. mdb '..

I changed the suffix of the Access database to accdb.

Confirm the suffix) and run it again. The same error is reported. I read the Excel file, but the suffix is not changed. I also use 2007.

The default suffix (XLSX) in is odd. Looked at the error. The format is incorrect. Is it system. Data. oledb?

I am not sure where the access data driver ODBC is mentioned.

Change to system. Data. ODBC and run ...... The prompt is not in another data format. Finally, I asked the boss, and he reminded me that he would

It won't be a problem between 2007 and 2003 (MDB is used in 2003 and accdb is used in 2007). I will change it to testdatasource. MDB

Save as access 2002-2003 database and run it again!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.