Service Virtualization

Expand all | Collapse all

how to load a file from a directory into VSM where the file name is dynamic

  • 1.  how to load a file from a directory into VSM where the file name is dynamic

    Posted Sep 11, 2018 07:26 AM

    Hi All,

     

    As you all know using Read a File step in VSM, we can load any file and store it into a property.

     

    actually the VSM that we were using  will generate file for each request and the file gets stored it in a directory with file name starting with year month and date etc..eg: 2018091103153664234021802222 

     

    this file name will not be same for each request. 

     

    in this case how to define the file name location in the Read a File step? [in order to load it and save the file to a property since the file name is not always same]

     

    PFA the screenshot for the Read a File test step. 

     

    J_NeSmith deoma03 Ulrich_Vogt

     

    Thanks,

    Sumalatha



  • 2.  Re: how to load a file from a directory into VSM where the file name is dynamic

    Broadcom Employee
    Posted Sep 12, 2018 12:57 AM

    Hi,

     

    Do you have any relationships between the request to Virtual service and the file which you mentioned?
    Is the file read from only one request to the Virtual service? Or is it read from multiple requests to the Virtual Service?
    How is it created?

     

    If you can get the file name before the "Read File step" and the file name is already save to a property, then you can read the target file from the "Read File step".
    In this case, you should change the "File:" field in "Read File step" as <fullpath of the location>/<your property name>.
    For example if you define the property name as datafile and the location is c:\temp, then the value of "File:" field is
    c:/temp/{{datafile}}

     

    Thank you,



  • 3.  Re: how to load a file from a directory into VSM where the file name is dynamic

    Posted Oct 12, 2018 09:07 AM

    Sumalatha,

     

    Did Yusuke's reply help you out?



  • 4.  Re: how to load a file from a directory into VSM where the file name is dynamic

    Posted Nov 02, 2018 05:53 AM

    yes it helped.

     

    Thanks Yusuke