R – SharePoint Visual Studio document upload Web Test fails with Connot close stream until all bytes are written

document-librarysharepointuploadvisual studiowebtest

I have created a Visual Studio 2008 sp1 test suite web test that uploads a document to a document library in SharePoint. The test is a lot like the one described here.

All is fine until the test is converted to a coded web test. Then the upload post returns the response

"Request failed: Connot close stream until all bytes are written"

Any ideas on how to get it going?

Best Answer

You can also use the Deployment settings in the testrunconfig. It's more sophisticated.