Use Relative Paths in File Upload/Downloads
I need to upload/download a file to a path relative to my test execution folder. I don't want to use an absolute file path.
Solution
This can only be done in a coded step. The key is to use this.ExecutionContext.DeploymentDirectory. This property identifies the folder the test is running in. You want to use it in a coded step to create an absolute path for file upload/download like this:
You'll have to add an assembly reference to System.Windows.Forms.dll and to include the following line at the top of your code file to use the given sample: