This is a migrated thread and some comments may be shown as answers.

FileUpload Dynamic Path

2 Answers 119 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
creulo
Top achievements
Rank 1
creulo asked on 02 Jun 2016, 06:36 AM
Hi. We are currently testing in different Virtual Machines, what we do is change the 'FileUploadPath' for each virtual machine. I just want to ask how do I create a FileUpload (Coded) step with Dynamic path so that we don't need to change the path every time we do a test on other machines. I'm looking forward to your answers. Thank you very much! :) 

2 Answers, 1 is accepted

Sort by
0
Aaron
Top achievements
Rank 1
answered on 02 Jun 2016, 02:18 PM

Assuming it is somewhere fairly common, you could use environment variables to come up with a path to the files...?

What are some of the paths as examples? Do they share anything in common?

 

You could use the following information to come up with a solution (it looks like this uses the 'System' namespace, so you shouldn't have to include anything extra either): 

https://msdn.microsoft.com/en-us/library/system.environment.expandenvironmentvariables.aspx

http://ss64.com/nt/syntax-variables.html

0
Aaron
Top achievements
Rank 1
answered on 02 Jun 2016, 02:20 PM
As an addition to my last post, you could also create environment variables on your VM's that have the same name, and then use them same solution I mentioned. This is in case the paths on the different machines don't share anything in common, or if there isn't an existing environment variable that would suit to your current path.
Tags
General Discussions
Asked by
creulo
Top achievements
Rank 1
Answers by
Aaron
Top achievements
Rank 1
Share this question
or