FileUpload Dynamic Path

2 posts, 0 answers
  1. creulo
    creulo avatar
    1 posts
    Member since:
    Feb 2016

    Posted 02 Jun Link to this post

    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. Aaron
    Aaron avatar
    31 posts
    Member since:
    May 2016

    Posted 02 Jun in reply to creulo Link to this post

    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

  3. Aaron
    Aaron avatar
    31 posts
    Member since:
    May 2016

    Posted 02 Jun in reply to Aaron Link to this post

    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.
Back to Top