- Last Updated: [[2020-12-04]]
- [[Visual Studio Load Testing]]
- # Problem
- When attempting to script the upload of a file, the script fails with an error similar to this:
- `Could not find file 'C:\Users\nvan1301\Documents\Visual Studio 2015\Projects\CRT\TestResults\nvan1301_W2608ST 2016-03-07 11_05_35\Out\SmallFile.pdf'.`
- # Cause
- Even though the file has been added to the project, it has not been identified as a deployment item.
- # Solution
- Click on the file in the Test Explorer. In the Properties, pane, select Build Action = Resource and Copy to Output Directory = Always.
- Double click on the Local.testsettings file. Click Deployment. Tick Enable deployment. Click Add File and add the relevant file. Click Apply.
- Click on the File Upload Parameter in the request. Change the Content Type parameter to the MIME type you want.
- Build the solution and run the test.